{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Trade and Tariff Dataset at the County level\n",
    "\n",
    "This notebook constructs a trade and county-level tariff data, over time, dataset. **This is a core notebook to the project** so I will try and explain each step clearly. This is one aspect of my code to be scrutinized. It outputs the county-level trade and tariff dataset as a `.parquet` file."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd             # data package\n",
    "import matplotlib.pyplot as plt # graphics \n",
    "import datetime as dt\n",
    "import numpy as np\n",
    "\n",
    "import requests, io             # internet and input tools  \n",
    "import zipfile as zf            # zip file tools \n",
    "import os  \n",
    "\n",
    "#import weightedcalcs as wc\n",
    "#import numpy as np\n",
    "\n",
    "import pyarrow as pa\n",
    "import pyarrow.parquet as pq"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [],
   "source": [
    "file_path = os.getcwd()\n",
    "\n",
    "fig_path = file_path +\"\\\\figures\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 1 Grab and manipulate the county level data for 2017\n",
    "\n",
    "So we will grab the single file, then adjust it to suit our needs. The needs are to construct county-level employment weights to create a trade exposure metric and tariff metric for each county."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Type of zipfile object: <class 'zipfile.ZipFile'>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\IPython\\core\\interactiveshell.py:3058: DtypeWarning: Columns (0) have mixed types. Specify dtype option on import or set low_memory=False.\n",
      "  interactivity=interactivity, compiler=compiler, result=result)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>area_fips</th>\n",
       "      <th>own_code</th>\n",
       "      <th>industry_code</th>\n",
       "      <th>agglvl_code</th>\n",
       "      <th>size_code</th>\n",
       "      <th>year</th>\n",
       "      <th>disclosure_code</th>\n",
       "      <th>annual_avg_estabs</th>\n",
       "      <th>annual_avg_emplvl</th>\n",
       "      <th>total_annual_wages</th>\n",
       "      <th>avg_annual_pay</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>1000</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>50</td>\n",
       "      <td>0</td>\n",
       "      <td>2017</td>\n",
       "      <td>NaN</td>\n",
       "      <td>124881</td>\n",
       "      <td>1936819</td>\n",
       "      <td>89088710816</td>\n",
       "      <td>45997</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>1000</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>51</td>\n",
       "      <td>0</td>\n",
       "      <td>2017</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1208</td>\n",
       "      <td>53131</td>\n",
       "      <td>4339038631</td>\n",
       "      <td>81668</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>1000</td>\n",
       "      <td>1</td>\n",
       "      <td>102</td>\n",
       "      <td>52</td>\n",
       "      <td>0</td>\n",
       "      <td>2017</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1208</td>\n",
       "      <td>53131</td>\n",
       "      <td>4339038631</td>\n",
       "      <td>81668</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>1000</td>\n",
       "      <td>1</td>\n",
       "      <td>1021</td>\n",
       "      <td>53</td>\n",
       "      <td>0</td>\n",
       "      <td>2017</td>\n",
       "      <td>NaN</td>\n",
       "      <td>610</td>\n",
       "      <td>11173</td>\n",
       "      <td>716001109</td>\n",
       "      <td>64083</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>1000</td>\n",
       "      <td>1</td>\n",
       "      <td>1022</td>\n",
       "      <td>53</td>\n",
       "      <td>0</td>\n",
       "      <td>2017</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>12</td>\n",
       "      <td>369309</td>\n",
       "      <td>30354</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  area_fips  own_code industry_code  agglvl_code  size_code  year  \\\n",
       "0      1000         0            10           50          0  2017   \n",
       "1      1000         1            10           51          0  2017   \n",
       "2      1000         1           102           52          0  2017   \n",
       "3      1000         1          1021           53          0  2017   \n",
       "4      1000         1          1022           53          0  2017   \n",
       "\n",
       "  disclosure_code  annual_avg_estabs  annual_avg_emplvl  total_annual_wages  \\\n",
       "0             NaN             124881            1936819         89088710816   \n",
       "1             NaN               1208              53131          4339038631   \n",
       "2             NaN               1208              53131          4339038631   \n",
       "3             NaN                610              11173           716001109   \n",
       "4             NaN                  2                 12              369309   \n",
       "\n",
       "   avg_annual_pay  \n",
       "0           45997  \n",
       "1           81668  \n",
       "2           81668  \n",
       "3           64083  \n",
       "4           30354  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "print(\"\")\n",
    "print(\"**********************************************************************************\")\n",
    "print(\"Downloading and processing BLS file\")\n",
    "print(\"\")\n",
    "\n",
    "url = \"https://data.bls.gov/cew/data/files/2017/csv/2017_annual_singlefile.zip\"\n",
    "# This will read in the annual, single file. It's big, but has all we want...\n",
    "\n",
    "r = requests.get(url) \n",
    "\n",
    "# convert bytes to zip file  \n",
    "bls_sf = zf.ZipFile(io.BytesIO(r.content)) \n",
    "print('Type of zipfile object:', type(bls_sf))\n",
    "\n",
    "clist = ['area_fips', 'own_code', 'industry_code', 'agglvl_code', 'size_code',\n",
    "       'year', 'disclosure_code', 'annual_avg_estabs',\n",
    "       'annual_avg_emplvl', 'total_annual_wages','avg_annual_pay']\n",
    "\n",
    "df = pd.read_csv(bls_sf.open(bls_sf.namelist()[0]), usecols= clist)\n",
    "\n",
    "# SHOULD PRESPECIFY TYPES TO \n",
    "\n",
    "df.head()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Then the file below cleans stuff up. The most important is the `NAICS_county_level` which selects the NAICS aggregation and then the county aggregation. Website describing this is here:\n",
    "\n",
    "[https://data.bls.gov/cew/doc/titles/agglevel/agglevel_titles.htm](https://data.bls.gov/cew/doc/titles/agglevel/agglevel_titles.htm)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "NAICS_county_level = 75 \n",
    "# This is the code that will select only counties at the 3 digit NAICS level\n",
    "\n",
    "df_county = df[df.agglvl_code == NAICS_county_level].copy()\n",
    "\n",
    "df_county = df_county[df_county.own_code == 5]\n",
    "# Only grab private stuff\n",
    "\n",
    "df_county = df_county[(df_county.area_fips.str[0:2] != \"72\") & (df_county.area_fips.str[0:2] != \"78\")\n",
    "              & (df_county.area_fips.str[0:2] != \"02\") & (df_county.area_fips.str[0:2] != \"15\")]\n",
    "#Drop puerto rico, alaska, hawaii...this mayb not be doing what I think it is...as it looks like these guys are there\n",
    "# Does not matter as analysis is performed withthem, drop them when do the map. \n",
    "\n",
    "df_county[\"sup_ind\"] = df_county.industry_code.str[1].astype(int)\n",
    "# sometimes there are super industries floating around we want to drop them.\n",
    "# not clear if this matters with the conditioning all ready\n",
    "\n",
    "df_county = df_county[df_county[\"sup_ind\"] > 0]\n",
    "\n",
    "df_county.area_fips = df_county.area_fips.astype(str)\n",
    "\n",
    "df_national = df_county.groupby(\"industry_code\").agg({\"annual_avg_emplvl\": \"sum\"})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_national.reset_index(inplace = True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_national.rename({\"annual_avg_emplvl\":\"nat_emplvl\"}, axis = 1, inplace = True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>industry_code</th>\n",
       "      <th>nat_emplvl</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>111</td>\n",
       "      <td>534697</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>112</td>\n",
       "      <td>228471</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>113</td>\n",
       "      <td>45166</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>114</td>\n",
       "      <td>5005</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>115</td>\n",
       "      <td>352957</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  industry_code  nat_emplvl\n",
       "0           111      534697\n",
       "1           112      228471\n",
       "2           113       45166\n",
       "3           114        5005\n",
       "4           115      352957"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_national.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's compute annual employment. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "115756851"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_county.annual_avg_emplvl.sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "which matches well with FRED (https://fred.stlouisfed.org/series/USPRIV) in 2017 (off by a couple million)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "### Step 2 Bring in the trade data\n",
    "\n",
    "Here we will read in data at the HS6 level, exports to china, over time. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>E_COMMODITY</th>\n",
       "      <th>CTY_CODE</th>\n",
       "      <th>ALL_VAL_MO</th>\n",
       "      <th>CTY_NAME</th>\n",
       "      <th>time</th>\n",
       "      <th>COMM_LVL</th>\n",
       "      <th>CTY_CODE</th>\n",
       "      <th>china_trade</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>212199</td>\n",
       "      <td>848620</td>\n",
       "      <td>5700</td>\n",
       "      <td>271529687</td>\n",
       "      <td>CHINA</td>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>5700</td>\n",
       "      <td>271529687.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>212200</td>\n",
       "      <td>848630</td>\n",
       "      <td>5700</td>\n",
       "      <td>0</td>\n",
       "      <td>CHINA</td>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>5700</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>212201</td>\n",
       "      <td>848640</td>\n",
       "      <td>5700</td>\n",
       "      <td>3324113</td>\n",
       "      <td>CHINA</td>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>5700</td>\n",
       "      <td>3324113.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>212202</td>\n",
       "      <td>848690</td>\n",
       "      <td>5700</td>\n",
       "      <td>35973744</td>\n",
       "      <td>CHINA</td>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>5700</td>\n",
       "      <td>35973744.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>212203</td>\n",
       "      <td>848710</td>\n",
       "      <td>5700</td>\n",
       "      <td>65070</td>\n",
       "      <td>CHINA</td>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>5700</td>\n",
       "      <td>65070.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>212204</td>\n",
       "      <td>848790</td>\n",
       "      <td>5700</td>\n",
       "      <td>4739978</td>\n",
       "      <td>CHINA</td>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>5700</td>\n",
       "      <td>4739978.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>212205</td>\n",
       "      <td>850110</td>\n",
       "      <td>5700</td>\n",
       "      <td>1751180</td>\n",
       "      <td>CHINA</td>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>5700</td>\n",
       "      <td>1751180.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>212206</td>\n",
       "      <td>850120</td>\n",
       "      <td>5700</td>\n",
       "      <td>492486</td>\n",
       "      <td>CHINA</td>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>5700</td>\n",
       "      <td>492486.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>212207</td>\n",
       "      <td>850131</td>\n",
       "      <td>5700</td>\n",
       "      <td>3413901</td>\n",
       "      <td>CHINA</td>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>5700</td>\n",
       "      <td>3413901.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>212208</td>\n",
       "      <td>850132</td>\n",
       "      <td>5700</td>\n",
       "      <td>917503</td>\n",
       "      <td>CHINA</td>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>5700</td>\n",
       "      <td>917503.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       E_COMMODITY CTY_CODE ALL_VAL_MO CTY_NAME       time COMM_LVL CTY_CODE  \\\n",
       "212199      848620     5700  271529687    CHINA 2019-08-01      HS6     5700   \n",
       "212200      848630     5700          0    CHINA 2019-08-01      HS6     5700   \n",
       "212201      848640     5700    3324113    CHINA 2019-08-01      HS6     5700   \n",
       "212202      848690     5700   35973744    CHINA 2019-08-01      HS6     5700   \n",
       "212203      848710     5700      65070    CHINA 2019-08-01      HS6     5700   \n",
       "212204      848790     5700    4739978    CHINA 2019-08-01      HS6     5700   \n",
       "212205      850110     5700    1751180    CHINA 2019-08-01      HS6     5700   \n",
       "212206      850120     5700     492486    CHINA 2019-08-01      HS6     5700   \n",
       "212207      850131     5700    3413901    CHINA 2019-08-01      HS6     5700   \n",
       "212208      850132     5700     917503    CHINA 2019-08-01      HS6     5700   \n",
       "\n",
       "        china_trade  \n",
       "212199  271529687.0  \n",
       "212200          0.0  \n",
       "212201    3324113.0  \n",
       "212202   35973744.0  \n",
       "212203      65070.0  \n",
       "212204    4739978.0  \n",
       "212205    1751180.0  \n",
       "212206     492486.0  \n",
       "212207    3413901.0  \n",
       "212208     917503.0  "
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "print(\"\")\n",
    "print(\"**********************************************************************************\")\n",
    "print(\"Downloading and processing Trade Data\")\n",
    "print(\"\")\n",
    "\n",
    "my_key = \"&key=34e40301bda77077e24c859c6c6c0b721ad73fc7\"\n",
    "# This is my key. I'm nice and I have it posted. If you will be doing more with this\n",
    "# please get your own key!\n",
    "\n",
    "end_use = \"hs?get=E_COMMODITY,CTY_CODE,ALL_VAL_MO,CTY_NAME\"\n",
    "\n",
    "url = \"https://api.census.gov/data/timeseries/intltrade/exports/\" + end_use \n",
    "url = url + my_key + \"&time==from+2015-01\" + \"&COMM_LVL=HS6\"\n",
    "\n",
    "url = url + \"&CTY_CODE=5700\"\n",
    "\n",
    "r = requests.get(url) \n",
    "\n",
    "df_china_trade = pd.DataFrame(r.json()[1:]) # This then converts it to a dataframe\n",
    "# Note that the first entry is the labels\n",
    "\n",
    "df_china_trade.columns = r.json()[0]\n",
    "\n",
    "df_china_trade.time = pd.to_datetime(df_china_trade.time, format=\"%Y-%m\")\n",
    "# This is so I can call this correctly...\n",
    "\n",
    "df_china_trade[\"china_trade\"] = df_china_trade.ALL_VAL_MO.astype(float)\n",
    "\n",
    "df_china_trade.E_COMMODITY = df_china_trade.E_COMMODITY.astype(str)\n",
    "\n",
    "df_china_trade.tail(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now grab **total exports** (not just China) by HS6 level, overtime. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>E_COMMODITY</th>\n",
       "      <th>ALL_VAL_MO</th>\n",
       "      <th>time</th>\n",
       "      <th>COMM_LVL</th>\n",
       "      <th>total_trade</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>731990</td>\n",
       "      <td>367517</td>\n",
       "      <td>2018-07-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>367517.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>741539</td>\n",
       "      <td>2291639</td>\n",
       "      <td>2018-07-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>2291639.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>940490</td>\n",
       "      <td>20158719</td>\n",
       "      <td>2018-07-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>20158719.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>681091</td>\n",
       "      <td>1820109</td>\n",
       "      <td>2015-01-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>1820109.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>940490</td>\n",
       "      <td>24781921</td>\n",
       "      <td>2017-12-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>24781921.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>5</td>\n",
       "      <td>570232</td>\n",
       "      <td>548938</td>\n",
       "      <td>2017-02-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>548938.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>6</td>\n",
       "      <td>681091</td>\n",
       "      <td>1157954</td>\n",
       "      <td>2017-02-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>1157954.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>7</td>\n",
       "      <td>731990</td>\n",
       "      <td>347333</td>\n",
       "      <td>2017-02-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>347333.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>8</td>\n",
       "      <td>741539</td>\n",
       "      <td>1431913</td>\n",
       "      <td>2017-02-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>1431913.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>9</td>\n",
       "      <td>940490</td>\n",
       "      <td>25386267</td>\n",
       "      <td>2019-01-01</td>\n",
       "      <td>HS6</td>\n",
       "      <td>25386267.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  E_COMMODITY ALL_VAL_MO       time COMM_LVL  total_trade\n",
       "0      731990     367517 2018-07-01      HS6     367517.0\n",
       "1      741539    2291639 2018-07-01      HS6    2291639.0\n",
       "2      940490   20158719 2018-07-01      HS6   20158719.0\n",
       "3      681091    1820109 2015-01-01      HS6    1820109.0\n",
       "4      940490   24781921 2017-12-01      HS6   24781921.0\n",
       "5      570232     548938 2017-02-01      HS6     548938.0\n",
       "6      681091    1157954 2017-02-01      HS6    1157954.0\n",
       "7      731990     347333 2017-02-01      HS6     347333.0\n",
       "8      741539    1431913 2017-02-01      HS6    1431913.0\n",
       "9      940490   25386267 2019-01-01      HS6   25386267.0"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "end_use = \"hs?get=E_COMMODITY,ALL_VAL_MO\"\n",
    "\n",
    "url = \"https://api.census.gov/data/timeseries/intltrade/exports/\"\n",
    "url = url + end_use + my_key + \"&time==from+2015-01\" + \"&COMM_LVL=HS6\"\n",
    "\n",
    "r = requests.get(url) \n",
    "\n",
    "df_all_trade = pd.DataFrame(r.json()[1:]) # This then converts it to a dataframe\n",
    "# Note that the first entry is the labels\n",
    "\n",
    "df_all_trade.columns = r.json()[0]\n",
    "\n",
    "df_all_trade.time = pd.to_datetime(df_all_trade.time, format=\"%Y-%m\")\n",
    "# This is so I can call this correctly...\n",
    "\n",
    "df_all_trade[\"total_trade\"] = df_all_trade.ALL_VAL_MO.astype(float)\n",
    "\n",
    "df_all_trade.E_COMMODITY = df_all_trade.E_COMMODITY.astype(str)\n",
    "\n",
    "df_all_trade.head(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Then combine the china trade and the all trade dataset."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "dftrade = df_all_trade.merge(df_china_trade[[\"E_COMMODITY\", \"time\",\"china_trade\"]], left_on = [\"E_COMMODITY\", \"time\"], \n",
    "                             right_on = [\"E_COMMODITY\", \"time\"], how = \"left\")\n",
    "\n",
    "dftrade.set_index(\"time\", inplace = True)\n",
    "\n",
    "dftrade.drop([\"ALL_VAL_MO\"], axis = 1, inplace = True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "### Step 3 Bring in concordance, create annual and national data set.\n",
    "\n",
    "Assign Naics codes, create a annual 2017 `df`, create the trade wieghts by naics so we can aggregate the tariffs."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "dftrade_17 = dftrade.loc[\"2017\"].groupby(\"E_COMMODITY\").agg({\"china_trade\":\"sum\"})"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Use the concordance from the US Census to go from HS6 to NAICS. In the code below there are two different approaches to working with the concordance. The latter one makes more sense. Ultimatly does not matter. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "#url = \"https://www.census.gov/foreign-trade/reference/codes/concordance/expconcord17.xls\"\n",
    "\n",
    "#df_concordance = pd.read_excel(url, dtype = {\"commodity\": str, \"naics\": str})\n",
    "\n",
    "#df_concordance[\"hs8\"] = df_concordance.commodity.str[0:8]\n",
    "# truncate down to get the hs8\n",
    "\n",
    "#df_concordance[\"hs6\"] = df_concordance.commodity.str[0:6]\n",
    "# truncate down to get the hs6\n",
    "\n",
    "#df_concordance[\"naics3\"] = df_concordance[\"naics\"].str[0:3]\n",
    "\n",
    "#dict_concordance = dict(zip(df_concordance.hs6,df_concordance.naics)) \n",
    "\n",
    "# This creates a dictionaty from which we can map the hs6 to the naics codes\n",
    "\n",
    "# Full disclosure. There is an issue with the creation of the dictionary as a unique \n",
    "# mapping from hs6 to naics. The notebook ``alt_hs_naics_mapping.ipynb'' provides a complete discussion.\n",
    "# Ultimatly, this does not matter for the results (relative to the alternative below)\n",
    "\n",
    "# Below is a fix/alternative approach to creating the mapping from hs6 to naics. In the\n",
    "# cases where there are multiple naics codes for each hs6 code, it assigns the naics code that is\n",
    "# associated with the most trade. \n",
    "\n",
    "# For future reference check this out: https://www.bea.gov/industry/zip/NDN0317.zip\n",
    "\n",
    "file_path = os.getcwd()\n",
    "\n",
    "alt_concordance = pq.read_table(file_path + \"\\\\data\\\\alt_concordance.parquet\").to_pandas()\n",
    "\n",
    "alt_concordance.head()\n",
    "\n",
    "dict_concordance = dict(zip(alt_concordance.hs6,alt_concordance.naics)) "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Then create this at different levels"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "dftrade_17[\"hs6\"] = dftrade_17.index\n",
    "\n",
    "dftrade_17[\"naics\"] = dftrade_17[\"hs6\"].map(dict_concordance)\n",
    "\n",
    "dftrade_17[\"naics4\"] = dftrade_17[\"naics\"].str[0:4]\n",
    "\n",
    "dftrade_17[\"naics3\"] = dftrade_17[\"naics\"].str[0:3]\n",
    "\n",
    "dftrade_17.rename({\"china_trade\":\"2017_china_trade\"}, axis = 1, inplace = True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>2017_china_trade</th>\n",
       "      <th>hs6</th>\n",
       "      <th>naics</th>\n",
       "      <th>naics4</th>\n",
       "      <th>naics3</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>E_COMMODITY</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>010121</td>\n",
       "      <td>29098.0</td>\n",
       "      <td>010121</td>\n",
       "      <td>112920</td>\n",
       "      <td>1129</td>\n",
       "      <td>112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>010129</td>\n",
       "      <td>27975.0</td>\n",
       "      <td>010129</td>\n",
       "      <td>112920</td>\n",
       "      <td>1129</td>\n",
       "      <td>112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>010130</td>\n",
       "      <td>8340.0</td>\n",
       "      <td>010130</td>\n",
       "      <td>112920</td>\n",
       "      <td>1129</td>\n",
       "      <td>112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>010190</td>\n",
       "      <td>0.0</td>\n",
       "      <td>010190</td>\n",
       "      <td>112920</td>\n",
       "      <td>1129</td>\n",
       "      <td>112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>010221</td>\n",
       "      <td>80280.0</td>\n",
       "      <td>010221</td>\n",
       "      <td>11211X</td>\n",
       "      <td>1121</td>\n",
       "      <td>112</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             2017_china_trade     hs6   naics naics4 naics3\n",
       "E_COMMODITY                                                \n",
       "010121                29098.0  010121  112920   1129    112\n",
       "010129                27975.0  010129  112920   1129    112\n",
       "010130                 8340.0  010130  112920   1129    112\n",
       "010190                    0.0  010190  112920   1129    112\n",
       "010221                80280.0  010221  11211X   1121    112"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dftrade_17.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This look good, we have the commodity (as the index), chinese trade, and then different codes to map stuff to. \n",
    "\n",
    "Here we will work at the NAICS 3 digit level. The rational for this is that if you go more disaggregate, then confidentialy issues lead to employment at the county-level to be drpoed from the QECW. This is just a simple ``.groupby`` operation. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "dftrade_17_naics3 = dftrade_17.groupby(\"naics3\").agg({\"2017_china_trade\": \"sum\"})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>2017_china_trade</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>naics3</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>1.578543e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>112</td>\n",
       "      <td>1.066820e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>113</td>\n",
       "      <td>1.316022e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>114</td>\n",
       "      <td>1.322142e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>211</td>\n",
       "      <td>6.731515e+09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        2017_china_trade\n",
       "naics3                  \n",
       "111         1.578543e+10\n",
       "112         1.066820e+08\n",
       "113         1.316022e+09\n",
       "114         1.322142e+09\n",
       "211         6.731515e+09"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dftrade_17_naics3.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now merge this with the national employment by naics data set."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_national = df_national.merge(dftrade_17_naics3[\"2017_china_trade\"],\n",
    "                                left_on = \"industry_code\", right_index = True, how = \"left\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_national[\"2017_china_trade\"].replace(np.nan, 0, inplace = True)\n",
    "\n",
    "df_national[\"trd_wts\"] = (df_national[\"2017_china_trade\"]/df_national[\"2017_china_trade\"].sum())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Then check to make sure that the trade weights sum up to one."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.0"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_national.trd_wts.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "dftrade[\"hs6\"] = dftrade.E_COMMODITY\n",
    "\n",
    "dftrade[\"naics\"] = dftrade[\"hs6\"].map(dict_concordance)\n",
    "\n",
    "dftrade[\"naics4\"] = dftrade[\"naics\"].str[0:4]\n",
    "\n",
    "dftrade[\"naics3\"] = dftrade[\"naics\"].str[0:3]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "### Step 4 Add in the tariff data...\n",
    "\n",
    "Now here is one of the harder parts.\n",
    "\n",
    "We want to take the time series data, then layer on the tariff data by product and time. So we will have a big data frame that is (at HS6 level) over time, but each unit of observation has the associated 2017 annual value and the tariff at that date. \n",
    "\n",
    "So we will use the `map` function to exploit this."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "#tariffs = pd.read_csv(\"tariff_list_naics.csv\", dtype = {\"HS-8 code\": str,\"HS6\": str,\"naics\": str,\"naics4\": str})\n",
    "\n",
    "file_path = os.getcwd() + \"\\\\data\"\n",
    "\n",
    "# bring in the tariff data\n",
    "\n",
    "tariffs = pd.read_csv(file_path + \"\\\\new_tariff_list_max.csv\", dtype = {\"hs6\": str})\n",
    "# This is the tariff dataset created by updated_tariff_data.ipynb (note the max tariff means taking the largest value\n",
    "# when going from Chinese hs10 to hs6. This does not matter, if anything gives more conservative resutls)\n",
    "\n",
    "tariffs.time_of_tariff = pd.to_datetime(tariffs.time_of_tariff, format=\"%Y-%m\")\n",
    "# make sure the time is there.\n",
    "\n",
    "tariffs.set_index(\"time_of_tariff\",inplace = True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>hs6</th>\n",
       "      <th>tariff</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>time_of_tariff</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>2018-01-01</td>\n",
       "      <td>010121</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-04-02</td>\n",
       "      <td>010121</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-05-01</td>\n",
       "      <td>010121</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-07-01</td>\n",
       "      <td>010121</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-07-06</td>\n",
       "      <td>010121</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   hs6  tariff\n",
       "time_of_tariff                \n",
       "2018-01-01      010121     0.0\n",
       "2018-04-02      010121     0.0\n",
       "2018-05-01      010121     0.0\n",
       "2018-07-01      010121     0.0\n",
       "2018-07-06      010121     0.0"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tariffs.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Then we create dictionaries to do the following \" you tell me HS, I tell you tariff\" by time. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "initial_tariff = dict(zip(tariffs.loc[\"2018-01-01\"].hs6,tariffs.loc[\"2018-01-01\"].tariff)) \n",
    "# These are the initial mfn tariffs. We will apply these from 2017 up untill the changes...\n",
    "\n",
    "tariff_dict_232 = dict(zip(tariffs.loc[\"2018-04-02\"].hs6,tariffs.loc[\"2018-04-02\"].tariff)) \n",
    "#These are the section 232 tariffs, response to US steel and aluminum. \n",
    "\n",
    "tariff_dict_r1 = dict(zip(tariffs.loc[\"2018-07-06\"].hs6,tariffs.loc[\"2018-07-06\"].tariff)) \n",
    "#tariff_dict_r1 = dict(zip(tariffs.loc[\"2018-07-06\"].HS6,tariffs.loc[\"2018-07-06\"].tariff)) \n",
    "# This will create a mapping from HS6 to tariff, you tell me HS, I tell you tariff\n",
    "\n",
    "tariff_dict_r2 = dict(zip(tariffs.loc[dt.datetime(2018,8,23)].hs6,tariffs.loc[dt.datetime(2018,8,23)].tariff)) \n",
    "\n",
    "#tariff_dict_r2 = dict(zip(tariffs.loc[dt.datetime(2018,8,23)].HS6,tariffs.loc[dt.datetime(2018,8,23)].tariff)) \n",
    "# This will create a mapping from HS6 to tariff, you tell me HS, I tell you tariff, round 2\n",
    "\n",
    "tariff_dict_r3 = dict(zip(tariffs.loc[dt.datetime(2018,9,24)].hs6,tariffs.loc[dt.datetime(2018,9,24)].tariff))\n",
    "#tariff_dict_r3 = dict(zip(tariffs.loc[dt.datetime(2018,9,24)].HS6,tariffs.loc[dt.datetime(2018,9,24)].tariff)) \n",
    "# This will create a mapping from HS6 to tariff, you tell me HS, I tell you tariff, round 3\n",
    "\n",
    "tariff_dict_mfn = dict(zip(tariffs.loc[\"2018-11-01\"].hs6,tariffs.loc[\"2018-11-01\"].tariff))\n",
    "# This reflects mfn adjustments that China made later in the year.\n",
    "\n",
    "tariff_dict_mfn_2019 = dict(zip(tariffs.loc[\"2019-01-02\"].hs6,tariffs.loc[\"2019-01-02\"].tariff))\n",
    "# This reflects mfn adjustments and auto adjustment China made at the start of 2019"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Then assign the tariffs to the hs6 codes. As mentioned below, the ``.update`` function updates the product code with a new tariff if there is one in the new dictionary."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>E_COMMODITY</th>\n",
       "      <th>COMM_LVL</th>\n",
       "      <th>total_trade</th>\n",
       "      <th>china_trade</th>\n",
       "      <th>hs6</th>\n",
       "      <th>naics</th>\n",
       "      <th>naics4</th>\n",
       "      <th>naics3</th>\n",
       "      <th>tariff</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>time</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>570232</td>\n",
       "      <td>HS6</td>\n",
       "      <td>549157.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>570232</td>\n",
       "      <td>314110</td>\n",
       "      <td>3141</td>\n",
       "      <td>314</td>\n",
       "      <td>6.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>681091</td>\n",
       "      <td>HS6</td>\n",
       "      <td>1638812.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>681091</td>\n",
       "      <td>327390</td>\n",
       "      <td>3273</td>\n",
       "      <td>327</td>\n",
       "      <td>10.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>731990</td>\n",
       "      <td>HS6</td>\n",
       "      <td>433431.0</td>\n",
       "      <td>15436.0</td>\n",
       "      <td>731990</td>\n",
       "      <td>339993</td>\n",
       "      <td>3399</td>\n",
       "      <td>339</td>\n",
       "      <td>7.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>741539</td>\n",
       "      <td>HS6</td>\n",
       "      <td>2684672.0</td>\n",
       "      <td>320784.0</td>\n",
       "      <td>741539</td>\n",
       "      <td>332722</td>\n",
       "      <td>3327</td>\n",
       "      <td>332</td>\n",
       "      <td>10.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>940490</td>\n",
       "      <td>HS6</td>\n",
       "      <td>22439517.0</td>\n",
       "      <td>118253.0</td>\n",
       "      <td>940490</td>\n",
       "      <td>314120</td>\n",
       "      <td>3141</td>\n",
       "      <td>314</td>\n",
       "      <td>10.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>080720</td>\n",
       "      <td>HS6</td>\n",
       "      <td>1718872.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>080720</td>\n",
       "      <td>111339</td>\n",
       "      <td>1113</td>\n",
       "      <td>111</td>\n",
       "      <td>65.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>280469</td>\n",
       "      <td>HS6</td>\n",
       "      <td>552582.0</td>\n",
       "      <td>3576.0</td>\n",
       "      <td>280469</td>\n",
       "      <td>331410</td>\n",
       "      <td>3314</td>\n",
       "      <td>331</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>760810</td>\n",
       "      <td>HS6</td>\n",
       "      <td>5641043.0</td>\n",
       "      <td>375803.0</td>\n",
       "      <td>760810</td>\n",
       "      <td>331318</td>\n",
       "      <td>3313</td>\n",
       "      <td>331</td>\n",
       "      <td>8.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>160413</td>\n",
       "      <td>HS6</td>\n",
       "      <td>85428.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>160413</td>\n",
       "      <td>311710</td>\n",
       "      <td>3117</td>\n",
       "      <td>311</td>\n",
       "      <td>30.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>160419</td>\n",
       "      <td>HS6</td>\n",
       "      <td>2592430.0</td>\n",
       "      <td>376530.0</td>\n",
       "      <td>160419</td>\n",
       "      <td>114111</td>\n",
       "      <td>1141</td>\n",
       "      <td>114</td>\n",
       "      <td>30.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>400912</td>\n",
       "      <td>HS6</td>\n",
       "      <td>6195357.0</td>\n",
       "      <td>209616.0</td>\n",
       "      <td>400912</td>\n",
       "      <td>326220</td>\n",
       "      <td>3262</td>\n",
       "      <td>326</td>\n",
       "      <td>10.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>521051</td>\n",
       "      <td>HS6</td>\n",
       "      <td>9576.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>521051</td>\n",
       "      <td>313210</td>\n",
       "      <td>3132</td>\n",
       "      <td>313</td>\n",
       "      <td>10.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>030241</td>\n",
       "      <td>HS6</td>\n",
       "      <td>40636.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>030241</td>\n",
       "      <td>114111</td>\n",
       "      <td>1141</td>\n",
       "      <td>114</td>\n",
       "      <td>7.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>961700</td>\n",
       "      <td>HS6</td>\n",
       "      <td>7901269.0</td>\n",
       "      <td>76630.0</td>\n",
       "      <td>961700</td>\n",
       "      <td>332439</td>\n",
       "      <td>3324</td>\n",
       "      <td>332</td>\n",
       "      <td>8.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>081010</td>\n",
       "      <td>HS6</td>\n",
       "      <td>40360544.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>081010</td>\n",
       "      <td>111333</td>\n",
       "      <td>1113</td>\n",
       "      <td>111</td>\n",
       "      <td>54.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>284019</td>\n",
       "      <td>HS6</td>\n",
       "      <td>18761335.0</td>\n",
       "      <td>7363561.0</td>\n",
       "      <td>284019</td>\n",
       "      <td>325180</td>\n",
       "      <td>3251</td>\n",
       "      <td>325</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>520959</td>\n",
       "      <td>HS6</td>\n",
       "      <td>295235.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>520959</td>\n",
       "      <td>313210</td>\n",
       "      <td>3132</td>\n",
       "      <td>313</td>\n",
       "      <td>10.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>810330</td>\n",
       "      <td>HS6</td>\n",
       "      <td>4897020.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>810330</td>\n",
       "      <td>910000</td>\n",
       "      <td>9100</td>\n",
       "      <td>910</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>842549</td>\n",
       "      <td>HS6</td>\n",
       "      <td>9273248.0</td>\n",
       "      <td>270898.0</td>\n",
       "      <td>842549</td>\n",
       "      <td>333999</td>\n",
       "      <td>3339</td>\n",
       "      <td>333</td>\n",
       "      <td>10.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>900640</td>\n",
       "      <td>HS6</td>\n",
       "      <td>228437.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>900640</td>\n",
       "      <td>333316</td>\n",
       "      <td>3333</td>\n",
       "      <td>333</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>481390</td>\n",
       "      <td>HS6</td>\n",
       "      <td>336104.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>481390</td>\n",
       "      <td>322121</td>\n",
       "      <td>3221</td>\n",
       "      <td>322</td>\n",
       "      <td>7.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>590900</td>\n",
       "      <td>HS6</td>\n",
       "      <td>5010127.0</td>\n",
       "      <td>374844.0</td>\n",
       "      <td>590900</td>\n",
       "      <td>313220</td>\n",
       "      <td>3132</td>\n",
       "      <td>313</td>\n",
       "      <td>8.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>732219</td>\n",
       "      <td>HS6</td>\n",
       "      <td>825685.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>732219</td>\n",
       "      <td>333414</td>\n",
       "      <td>3334</td>\n",
       "      <td>333</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>200820</td>\n",
       "      <td>HS6</td>\n",
       "      <td>416953.0</td>\n",
       "      <td>8796.0</td>\n",
       "      <td>200820</td>\n",
       "      <td>311421</td>\n",
       "      <td>3114</td>\n",
       "      <td>311</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>282510</td>\n",
       "      <td>HS6</td>\n",
       "      <td>394266.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>282510</td>\n",
       "      <td>325180</td>\n",
       "      <td>3251</td>\n",
       "      <td>325</td>\n",
       "      <td>5.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           E_COMMODITY COMM_LVL  total_trade  china_trade     hs6   naics  \\\n",
       "time                                                                        \n",
       "2018-08-01      570232      HS6     549157.0          NaN  570232  314110   \n",
       "2018-08-01      681091      HS6    1638812.0          0.0  681091  327390   \n",
       "2018-08-01      731990      HS6     433431.0      15436.0  731990  339993   \n",
       "2018-08-01      741539      HS6    2684672.0     320784.0  741539  332722   \n",
       "2018-08-01      940490      HS6   22439517.0     118253.0  940490  314120   \n",
       "2018-08-01      080720      HS6    1718872.0          NaN  080720  111339   \n",
       "2018-08-01      280469      HS6     552582.0       3576.0  280469  331410   \n",
       "2018-08-01      760810      HS6    5641043.0     375803.0  760810  331318   \n",
       "2018-08-01      160413      HS6      85428.0          NaN  160413  311710   \n",
       "2018-08-01      160419      HS6    2592430.0     376530.0  160419  114111   \n",
       "2018-08-01      400912      HS6    6195357.0     209616.0  400912  326220   \n",
       "2018-08-01      521051      HS6       9576.0          NaN  521051  313210   \n",
       "2018-08-01      030241      HS6      40636.0          NaN  030241  114111   \n",
       "2018-08-01      961700      HS6    7901269.0      76630.0  961700  332439   \n",
       "2018-08-01      081010      HS6   40360544.0          NaN  081010  111333   \n",
       "2018-08-01      284019      HS6   18761335.0    7363561.0  284019  325180   \n",
       "2018-08-01      520959      HS6     295235.0          NaN  520959  313210   \n",
       "2018-08-01      810330      HS6    4897020.0          NaN  810330  910000   \n",
       "2018-08-01      842549      HS6    9273248.0     270898.0  842549  333999   \n",
       "2018-08-01      900640      HS6     228437.0          NaN  900640  333316   \n",
       "2018-08-01      481390      HS6     336104.0          NaN  481390  322121   \n",
       "2018-08-01      590900      HS6    5010127.0     374844.0  590900  313220   \n",
       "2018-08-01      732219      HS6     825685.0          0.0  732219  333414   \n",
       "2018-08-01      200820      HS6     416953.0       8796.0  200820  311421   \n",
       "2018-08-01      282510      HS6     394266.0          0.0  282510  325180   \n",
       "\n",
       "           naics4 naics3  tariff  \n",
       "time                              \n",
       "2018-08-01   3141    314     6.0  \n",
       "2018-08-01   3273    327    10.5  \n",
       "2018-08-01   3399    339     7.0  \n",
       "2018-08-01   3327    332    10.0  \n",
       "2018-08-01   3141    314    10.0  \n",
       "2018-08-01   1113    111    65.0  \n",
       "2018-08-01   3314    331     4.0  \n",
       "2018-08-01   3313    331     8.0  \n",
       "2018-08-01   3117    311    30.0  \n",
       "2018-08-01   1141    114    30.0  \n",
       "2018-08-01   3262    326    10.0  \n",
       "2018-08-01   3132    313    10.0  \n",
       "2018-08-01   1141    114     7.0  \n",
       "2018-08-01   3324    332     8.0  \n",
       "2018-08-01   1113    111    54.0  \n",
       "2018-08-01   3251    325     2.0  \n",
       "2018-08-01   3132    313    10.0  \n",
       "2018-08-01   9100    910     0.0  \n",
       "2018-08-01   3339    333    10.0  \n",
       "2018-08-01   3333    333     5.0  \n",
       "2018-08-01   3221    322     7.5  \n",
       "2018-08-01   3132    313     8.0  \n",
       "2018-08-01   3334    333    21.0  \n",
       "2018-08-01   3114    311     5.0  \n",
       "2018-08-01   3251    325     5.5  "
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dftrade[\"tariff\"] = 0\n",
    "\n",
    "# Then use the map function which will fill in the tariff in the correct places..\n",
    "# Note the key issue was that the dictionaries were overwritting stuff, hence\n",
    "# the update...\n",
    "\n",
    "# Start with the MFN...\n",
    "dftrade.loc[\"2015-01\":,\"tariff\"] = dftrade.loc[\"2015-01\":,\"hs6\"].map(initial_tariff)\n",
    "\n",
    "#print(\"done\")\n",
    "# Now update given the 232 response\n",
    "initial_tariff.update(tariff_dict_232)\n",
    "\n",
    "dftrade.loc[\"2018-04\":,\"tariff\"] = dftrade.loc[\"2018-04\":,\"hs6\"].map(initial_tariff)\n",
    "\n",
    "#print(\"done\")\n",
    "# This is the big Phase 1 of the war\n",
    "initial_tariff.update(tariff_dict_r1)\n",
    "\n",
    "dftrade.loc[\"2018-07\":,\"tariff\"] = dftrade.loc[\"2018-07\":,\"hs6\"].map(initial_tariff)\n",
    "\n",
    "#print(\"done\")\n",
    "# Here is phase 2\n",
    "initial_tariff.update(tariff_dict_r2)\n",
    "\n",
    "dftrade.loc[\"2018-09\":,\"tariff\"] = dftrade.loc[\"2018-09\":,\"hs6\"].map(initial_tariff)\n",
    "\n",
    "#print(\"done\")\n",
    "# Here is phase 3\n",
    "initial_tariff.update(tariff_dict_r3)\n",
    "\n",
    "dftrade.loc[\"2018-10\":,\"tariff\"] = dftrade.loc[\"2018-10\":,\"hs6\"].map(initial_tariff)\n",
    "\n",
    "#print(\"done\")\n",
    "# China then adjusts the mfn\n",
    "initial_tariff.update(tariff_dict_mfn)\n",
    "\n",
    "dftrade.loc[\"2018-11\":,\"tariff\"] = dftrade.loc[\"2018-11\":,\"hs6\"].map(initial_tariff)\n",
    "\n",
    "#print(\"done\")\n",
    "# An update on the mfn's\n",
    "initial_tariff.update(tariff_dict_mfn_2019)\n",
    "\n",
    "dftrade.loc[\"2019-01\":,\"tariff\"] = dftrade.loc[\"2019-01\":,\"hs6\"].map(initial_tariff)\n",
    "\n",
    "dftrade[\"tariff\"] = dftrade[\"tariff\"].replace(np.nan,0)\n",
    "\n",
    "dftrade[dftrade[\"tariff\"] == 25].head()\n",
    "\n",
    "dftrade[\"2018-08\"].head(25)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This is looking good, not how you can see the tariffs (in august of 2018) hitting in the right places.\n",
    "\n",
    "Now merge it with the 2017 annual trade data so we can construct trade weighted averages of tariffs...."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "dftrade = dftrade.merge(dftrade_17[\"2017_china_trade\"], how = \"inner\", left_on = \"E_COMMODITY\", right_index = True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>E_COMMODITY</th>\n",
       "      <th>COMM_LVL</th>\n",
       "      <th>total_trade</th>\n",
       "      <th>china_trade</th>\n",
       "      <th>hs6</th>\n",
       "      <th>naics</th>\n",
       "      <th>naics4</th>\n",
       "      <th>naics3</th>\n",
       "      <th>tariff</th>\n",
       "      <th>2017_china_trade</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>time</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>100610</td>\n",
       "      <td>HS6</td>\n",
       "      <td>47646310.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100610</td>\n",
       "      <td>111160</td>\n",
       "      <td>1111</td>\n",
       "      <td>111</td>\n",
       "      <td>90.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>100590</td>\n",
       "      <td>HS6</td>\n",
       "      <td>546022034.0</td>\n",
       "      <td>9248244.0</td>\n",
       "      <td>100590</td>\n",
       "      <td>111150</td>\n",
       "      <td>1111</td>\n",
       "      <td>111</td>\n",
       "      <td>90.0</td>\n",
       "      <td>151883243.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-12-01</td>\n",
       "      <td>100119</td>\n",
       "      <td>HS6</td>\n",
       "      <td>14503229.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100119</td>\n",
       "      <td>111140</td>\n",
       "      <td>1111</td>\n",
       "      <td>111</td>\n",
       "      <td>90.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-12-01</td>\n",
       "      <td>100590</td>\n",
       "      <td>HS6</td>\n",
       "      <td>793327486.0</td>\n",
       "      <td>1006510.0</td>\n",
       "      <td>100590</td>\n",
       "      <td>111150</td>\n",
       "      <td>1111</td>\n",
       "      <td>111</td>\n",
       "      <td>90.0</td>\n",
       "      <td>151883243.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-07-01</td>\n",
       "      <td>100590</td>\n",
       "      <td>HS6</td>\n",
       "      <td>572600231.0</td>\n",
       "      <td>87519.0</td>\n",
       "      <td>100590</td>\n",
       "      <td>111150</td>\n",
       "      <td>1111</td>\n",
       "      <td>111</td>\n",
       "      <td>90.0</td>\n",
       "      <td>151883243.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2017-02-01</td>\n",
       "      <td>100310</td>\n",
       "      <td>HS6</td>\n",
       "      <td>23376.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100310</td>\n",
       "      <td>111199</td>\n",
       "      <td>1111</td>\n",
       "      <td>111</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-07-01</td>\n",
       "      <td>100310</td>\n",
       "      <td>HS6</td>\n",
       "      <td>4200.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100310</td>\n",
       "      <td>111199</td>\n",
       "      <td>1111</td>\n",
       "      <td>111</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-02-01</td>\n",
       "      <td>100310</td>\n",
       "      <td>HS6</td>\n",
       "      <td>29830.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100310</td>\n",
       "      <td>111199</td>\n",
       "      <td>1111</td>\n",
       "      <td>111</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2015-09-01</td>\n",
       "      <td>100310</td>\n",
       "      <td>HS6</td>\n",
       "      <td>10337.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100310</td>\n",
       "      <td>111199</td>\n",
       "      <td>1111</td>\n",
       "      <td>111</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2015-03-01</td>\n",
       "      <td>120910</td>\n",
       "      <td>HS6</td>\n",
       "      <td>3917214.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>120910</td>\n",
       "      <td>111991</td>\n",
       "      <td>1119</td>\n",
       "      <td>111</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10824 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           E_COMMODITY COMM_LVL  total_trade  china_trade     hs6   naics  \\\n",
       "time                                                                        \n",
       "2019-08-01      100610      HS6   47646310.0          NaN  100610  111160   \n",
       "2019-08-01      100590      HS6  546022034.0    9248244.0  100590  111150   \n",
       "2018-12-01      100119      HS6   14503229.0          NaN  100119  111140   \n",
       "2018-12-01      100590      HS6  793327486.0    1006510.0  100590  111150   \n",
       "2019-07-01      100590      HS6  572600231.0      87519.0  100590  111150   \n",
       "...                ...      ...          ...          ...     ...     ...   \n",
       "2017-02-01      100310      HS6      23376.0          NaN  100310  111199   \n",
       "2018-07-01      100310      HS6       4200.0          NaN  100310  111199   \n",
       "2019-02-01      100310      HS6      29830.0          NaN  100310  111199   \n",
       "2015-09-01      100310      HS6      10337.0          NaN  100310  111199   \n",
       "2015-03-01      120910      HS6    3917214.0          NaN  120910  111991   \n",
       "\n",
       "           naics4 naics3  tariff  2017_china_trade  \n",
       "time                                                \n",
       "2019-08-01   1111    111    90.0               0.0  \n",
       "2019-08-01   1111    111    90.0       151883243.0  \n",
       "2018-12-01   1111    111    90.0               0.0  \n",
       "2018-12-01   1111    111    90.0       151883243.0  \n",
       "2019-07-01   1111    111    90.0       151883243.0  \n",
       "...           ...    ...     ...               ...  \n",
       "2017-02-01   1111    111     0.0               0.0  \n",
       "2018-07-01   1111    111     0.0               0.0  \n",
       "2019-02-01   1111    111     0.0               0.0  \n",
       "2015-09-01   1111    111     0.0               0.0  \n",
       "2015-03-01   1119    111     0.0               0.0  \n",
       "\n",
       "[10824 rows x 10 columns]"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dftrade[dftrade.naics3 == \"111\"].sort_values(by = [\"tariff\"], ascending = False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Looks like we accomplished this task.\n",
    "\n",
    "Now what we will do is create a function which will make the trade weighted verage of the tariff rates as we aggregate across product codes."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "def trd_weighted_avg(df):\n",
    "    # A function to create the trade weighted average of the tariff rates\n",
    "    # by round...\n",
    "    \n",
    "    trd_w_avg = df[\"tariff\"].multiply(df[\"2017_china_trade\"],axis = 0).sum() \n",
    "    # here wuse the 2017 annual values to weight it\n",
    "    \n",
    "    trd_w_avg = trd_w_avg / df[\"2017_china_trade\"].sum()\n",
    "    \n",
    "    \n",
    "    foo = {\"tariff_trd_w_avg\": [trd_w_avg ], \n",
    "           \"total_trade\": df[\"total_trade\"].sum(),\n",
    "          \"china_trade\" : df[\"china_trade\"].sum()}\n",
    "    \n",
    "    return pd.DataFrame(foo)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now, `groupby` time and NAICS code (in this case 3), apply the trade weighted function above. Then the resulting data frame should be time, and naics tariffs and the total trade. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:8: RuntimeWarning: invalid value encountered in double_scalars\n",
      "  \n"
     ]
    }
   ],
   "source": [
    "grp = dftrade.groupby([\"time\",\"naics3\"])\n",
    "\n",
    "exp_trf_bynaics = grp.apply(trd_weighted_avg)\n",
    "\n",
    "exp_trf_bynaics = exp_trf_bynaics.droplevel(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>tariff_trd_w_avg</th>\n",
       "      <th>total_trade</th>\n",
       "      <th>china_trade</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>time</th>\n",
       "      <th>naics3</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td rowspan=\"15\" valign=\"top\">2018-01-01</td>\n",
       "      <td>111</td>\n",
       "      <td>7.738951</td>\n",
       "      <td>6.044481e+09</td>\n",
       "      <td>1.580785e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>112</td>\n",
       "      <td>11.923402</td>\n",
       "      <td>1.404933e+08</td>\n",
       "      <td>1.722368e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>113</td>\n",
       "      <td>0.185764</td>\n",
       "      <td>2.036270e+08</td>\n",
       "      <td>8.089366e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>114</td>\n",
       "      <td>8.826240</td>\n",
       "      <td>2.423345e+08</td>\n",
       "      <td>5.709779e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>211</td>\n",
       "      <td>0.656623</td>\n",
       "      <td>4.646889e+09</td>\n",
       "      <td>9.177222e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>212</td>\n",
       "      <td>1.669023</td>\n",
       "      <td>1.505520e+09</td>\n",
       "      <td>1.383602e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>311</td>\n",
       "      <td>11.732877</td>\n",
       "      <td>5.094319e+09</td>\n",
       "      <td>2.287681e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>312</td>\n",
       "      <td>10.654408</td>\n",
       "      <td>6.084754e+08</td>\n",
       "      <td>8.101847e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>313</td>\n",
       "      <td>9.065944</td>\n",
       "      <td>7.326278e+08</td>\n",
       "      <td>2.913878e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>314</td>\n",
       "      <td>9.958472</td>\n",
       "      <td>2.601312e+08</td>\n",
       "      <td>4.274722e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>315</td>\n",
       "      <td>15.546809</td>\n",
       "      <td>4.048624e+08</td>\n",
       "      <td>7.298691e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>316</td>\n",
       "      <td>9.889121</td>\n",
       "      <td>2.988748e+08</td>\n",
       "      <td>3.691118e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>321</td>\n",
       "      <td>0.180372</td>\n",
       "      <td>5.539431e+08</td>\n",
       "      <td>1.309546e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>322</td>\n",
       "      <td>2.215004</td>\n",
       "      <td>2.021641e+09</td>\n",
       "      <td>2.241574e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>323</td>\n",
       "      <td>3.078089</td>\n",
       "      <td>4.107334e+08</td>\n",
       "      <td>1.171687e+07</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   tariff_trd_w_avg   total_trade   china_trade\n",
       "time       naics3                                              \n",
       "2018-01-01 111             7.738951  6.044481e+09  1.580785e+09\n",
       "           112            11.923402  1.404933e+08  1.722368e+06\n",
       "           113             0.185764  2.036270e+08  8.089366e+07\n",
       "           114             8.826240  2.423345e+08  5.709779e+07\n",
       "           211             0.656623  4.646889e+09  9.177222e+08\n",
       "           212             1.669023  1.505520e+09  1.383602e+08\n",
       "           311            11.732877  5.094319e+09  2.287681e+08\n",
       "           312            10.654408  6.084754e+08  8.101847e+06\n",
       "           313             9.065944  7.326278e+08  2.913878e+07\n",
       "           314             9.958472  2.601312e+08  4.274722e+06\n",
       "           315            15.546809  4.048624e+08  7.298691e+06\n",
       "           316             9.889121  2.988748e+08  3.691118e+07\n",
       "           321             0.180372  5.539431e+08  1.309546e+08\n",
       "           322             2.215004  2.021641e+09  2.241574e+08\n",
       "           323             3.078089  4.107334e+08  1.171687e+07"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "exp_trf_bynaics.loc[\"2018-01\"].head(15)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAuYAAAHkCAYAAAByuerFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nOzdeXxU5fn//9edhCRCIBCWhAAJ+74TBHFDQXFfwX3fWqv9iAhWa1uX9tNabWv9tF/balvxp3UHBRFRWaKCQkkEBWQLQkISkrAlBEhClvv3x5nEZJKQTJjMwryfj0ceOmfOcs11n6PX3HOf+xhrLSIiIiIi4l9h/g5ARERERERUmIuIiIiIBAQV5iIiIiIiAUCFuYiIiIhIAFBhLiIiIiISAFSYi4iIiIgEgJOiMDfG/NMYY40xf/J3LIHGGJNkjPmrMWa7MabUGHPYGLPWGPOYMSbWtU5vV/7uasb+dhlj5rZ64F5mjHnC9Rmb+rvNS8d72hhT6raspzHmQ2PMQdexfuxafpUxZpMxpsy1PNobMbSEMeZNY0xGI+9d4IrvjFrLOhpjfmuM2WyMOWqMOWCM+cYY8zdjTFwTx3r6OO2w2tufz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HDmS+fPnN7ruhx9+yNixYxkxYgRnn302O3furPP+a6+9xpw5c/jyyy+ZNGkSQ4cOZejQocyZM4eqqqqa9V566SX69+9Pv379uP/++2vey8nJ4ZxzziE2NpaUlJQ6+66qquKBBx5g2LBhjBgxggsuuIDc3Nxmfca8vDxuueUW+vbty/DhwxkzZgwvvfQSALfddht//etfG9zuV7/6FW+99VazjtEcaWlp3HjjjV7bnzjWr19f73zxNmMMhw8fbtVjiDQmo96NnxrGIi2nwlwkQFlrufnmm3n11VdZv349r732GrfeemudIrrawYMHufXWW3nzzTfZsGEDd999N/fee2+ddd5//30uv/xyOnTowCuvvMJ3333HunXr+Oqrr/jPf/4DwM6dO3nyySf56quv2L59O9u3b+e115yHZsTExPDkk0/WrFvbwoULWbNmDd988w0bNmxg6NCh/OY3v2nyMx49epSzzz6bIUOGkJGRwcaNG1mxYkWDn9HdU089xbXXXtvkes2VkpLS4GcTETmeej3mvTSHubScCnMPxMbG6gl2ISCQ2jksLIyiIuemosLCQrp3705YWP3LNiMjg/j4eAYOHAjARRddxMcff8y+ffsA5472r7/+mkmTJjF8+HAGDBgAQFRUFGPGjKmZiurdd9/liiuuoGvXroSFhXH33XfX9ErHxsZy1llnERMTU+/4xhjKysooLS2lqqqK4uJievbs2eTne/3114mLi+PRRx+t+VwdO3bkRz/6Uc06Gzdu5Nxzz2XAgAHccsstVD+tuHZv+hNPPMH111/PRRddxODBg7n44os5evQoAMuWLeO0005jzJgxjBgxgjfffLPBWFJTU2t6dnft2kWXLl149NFHGTNmDIMHDyY9PZ27776bkSNHMmHCBPLy8gCYO3cu5513HldffTWjRo3i3HPPJScnB4DKykpmz57N8OHDGT58OLNnz6ayshKAF198kSFDhtT8GrJlyxYAtm7dyoUXXsj48eMZNWoUL7/8MuB8iZkxYwZDhw5l1KhRXHPNNQ1+jieffJLBgwczevRoxowZQ2FhIQBr1qzhnHPOYdy4cYwbN44PP/ywZptFixaRkpLCqFGjGDNmDN9++y0AS5YsYcyYMYwcOZIpU6aQkZFRk6vRo0fzox/9iJEjRzJq1Cg2b95cs79f/OIX9O/fn7vuuosvv/yy0fb/4x//yPjx4xkzZgynnXYa69evr3nPGMNvf/tbxo8fT9++fZk3b17Ne/Pnz2fw4MFMmjSpWV8AA+maDhXBnvPu3bvTvXv3Zq27PetAndcnOlUiBH/+vC2k8mGtDbq/cePGWZFQsHTpUtu5c2eblJRkO3XqZL/88ssG1yssLLRxcXH2v//9r7XW2v/7v/+zgE1PT7fWWrto0SJ7++2319suPz/fdu/e3X799dfWWmvvv/9++8wzz9S8v2bNGjtixIg626xYscK6X4OVlZV25syZtl27drZr1672zDPPtGVlZdZaa3NycuyoUaMajPvee++1DzzwQKOf/9Zbb7Wnn366LSkpsWVlZXbo0KH2k08+qXnvL3/5i7XW2scff9z279/fHjx40FZVVdnzzjvPvvjii9Zaaw8cOGArKiqstdbm5eXZHj162AMHDtQ7Vu3PtXPnTgvYRYsWWWutfeaZZ2xsbKxdt25dTdyPPfaYtdbal19+2UZHR9stW7ZYa6194okn7NVXX22ttfaFF16wU6ZMsWVlZbasrMyee+659oUXXrDWWtuhQweblZVlrbW2tLTUHjlyxJaXl9uxY8fazZs3W2utPXTokB04cKDdvHmznT9/vp0yZUpNvA19hgMHDtiYmBh79OjRmu3Ly8vtwYMH7ejRo21ubq611trc3Fzbo0cPe/DgQbt161YbHx9vt23bVhPLoUOHbH5+vu3SpYvdtGmTtdbaf/7zn/bUU0+tyVVERETNefOb3/zG3nDDDdZaaxcuXGhHjBhhi4uLbUVFhb3kkkvqnS/VCgoKav79008/tRMmTKh5DdS078qVK21iYqK11jln4+LiavL9+9//3gK2uLi4wWOItKbSsnLb75I/2d4X/aHmr/homb/DEu/zWY2rHnORAFVRUcHvfvc7FixYQGZmJh988AHXXnttg2NpY2Njeeutt3jwwQdJSUmhoKCAjh070qaNMzPAggULuPzyy+tsU1xczGWXXcZDDz3EmDFjTijWr7/+ms2bN5OTk8OePXsYNWoUs2bNAiAxMbFOT2htttZMBo254oori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+Bu/TSS5k4cSJPPfVUnWNeffXVvP/+++zdu5eqqipeeumlRscy19anTx+WLVtWU4QtXryY4cOHN7nd9ddfz969e3n22WdrCq7CwsKaLx3eUFhYSO/evTHG8Omnn9bp6faWVatWsX37dsD5knLOOecAcN555zF37lzKy8spLy/nlVdeYerUqVRUVPD9999z6qmn8sgjj3D++eezbt06Bg0aRNu2bXn11Vdr9r1lyxYOHTpEdnY24eHhXHHFFTz33HPs3buXAwfqjm0tLi5m7969nH322Tz55JMMHz6cjRs3MmnSJLZv386KFStq1l27di3WWqZNm8bixYtr4i8rK6O4uLhmzHf12PdXXnmFMWPGNFmoTJkyhbfffpsjR46wc+dO5s6d2+B6paWlVFRU1Hzxe+GFF5qV69NOO41169bVxPvPf/6zyW0C5ZoOJcGe8/T0dNLT05tcb/tu98LcO1MlBnv+vC2U8qEec5EAlZCQwN/+9jemT59ec2Pkyy+/TFxcw1Nx/eIXv2DVqlUcO3aM888/n6effhr4YTaWav/6179ITU1l//79fPzxxwDMmDGDxx57jL59+/LLX/6SiRMnAnD++edz0003Ac6NjMnJyZSVlVFUVETPnj256667eOKJJ7jvvvvYtGkTI0eOJCIigqSkJF588UUAcnNzueiiixrsBW7Xrh2fffYZDz/8MH379iUmJoY2bdpw3333eSmL8PTTT/OTn/yEp59+mpEjRzJy5Eiv7bva2WefzeOPP86mTZvo3LlzTWF9zz33kJGRUTPkY9q0adx9991UVFRw2223UVhYSFhYGL169eLpp58mIiKCDz74gJkzZ/Lss89SWVlJfHw8b7/9Nhs2bOCRRx4BnLZ49NFHSUxMrBNHUVERV199NSUlJVRVVTF27FiuuuoqoqOjWbhwIXPmzGHmzJkcO3aMvn378sEHHzBgwABeeuklrr32WiorKwkPD+eVV15hxIgRvPrqq9xwww1UVFTQtWvXmhl6jueSSy7hq6++YvTo0SQkJHDaaaeRn59fb70OHTrw1FNPMX78eJKSkrjwwgubletu3brx4osvcumllxIXF9esL44irUVTJYq3mZb8LOhvKSkpNi0tzefH3bZtG0DN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Hj11Ve5//77WbVqFXfddReVlZU899xzQGOrxQcffICvry9KKW655Rbefvtt7rrrrnafy97evt1tnnzySbPh9AoLC7n55pvZunUrMTExvPXWW8ydO5cdO3YAjeNpv/rqq7z00ktA4wRFH374IbfccgtZWVmkpaXxySefmB3n6dOnc/XVV5OcnMw999wDNE6etG7dOtzd3WloaGD69Ol8/vnn+njW27ZtY/fu3fj5+Zm9lrlz53L06FGznDQ0NOjLJSUlPPfccxQWFuLq6kpFRQWurq5dcciEsAhr+cy0ljhsiTXlfFOLbiyj4iLanO2zuabZny3Vcm5N+bMGtpSPHivMNU17G7gSKFRKxf68zgf4EIgCMoHrlVIlPRVTZxUUFAC28cY4l1tuuUX/e+3ataSlpZGYmAg0tnC3lx+TycRzzz3HZ599htFopKSkRJ8ptD2d2WbHjh3ExcURExMDwMKFC1m8eDEVFY0tJQMGDGDUqFH645cuXcpvf/tbbrnlFl599VVuvfVWnJycyMzMBNo/zkajkWXLlvH999+jlCI/P5/09HS9MJ8xY0arorwjPD09GTRoEPPmzeOyyy7jyiuvxMPDo9P7EcJaWMtnprXEYUusKeebWnRj6chsn03jZluqMLem/FkDW8pHT3ZlWQm0nCLvIWCTUmoAsOnnZWHl3N3d9b+VUvzxj38kPT2d9PR09u/fz3fffdfmdh988AHffvst33zzDfv27WPx4sVmXUkudBul1Dkv5mkeN8Do0aMxGo189913vPPOO9x5553njKXJCy+8QElJCTt27OCnn35i5syZZjG1fJ6Osre3Z/v27SxdupScnBySkpL46aefftW+hBBCQHFpNektZvucNELGLxfWq8cKc6XUNuBsi9XXAO/8/Pc7wMyeikd0jauvvppXXnmFkpLGHzrq6urYu3cv0NgC3PTzE0BpaSl+fn54eHhQVlbWqj93W861Tcv9jxo1ivT0dA4dOgTAO++8Q0JCwjlbne+9915uvPFGRo0aRXh4eJuPaet1BAcH4+LiQm5uLp9++ul5X0dHVFRUUFRUxPjx43niiSeIjY1l//79XbJvIYSwRVt+PEHzGc6H9g8g2F9+iRTWy9J9zAOV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CggAcffJDdu3cDMGPGDB5//HEAFixYwNq1a/Hz80MpxdatWwkLC2PXrl3MmzePvLw8AJ599lkmTZpUq7xVT80EW3eHsrIyx1nPd955h7vvvhsPDw8iIiK47rrr+Ne//sWjjz5Kjx49ANtTUC9Wlzk5OVx66aUEBASwY8cOXnjhBd5++20qKirw9/fnn//8J5deajt7pJTiueee4+OPP+aKK66ge/fujvq84oorKC4uZvTo0YwbN46dO3fWeH/XXXdx++23U1hYSEVFBbfffnudD2XatGkTTzzxBBUVFURERLB06VJ69OhBYmIic+bM4fLLL+ebb75BKcW6devo06dPrXUsWLCAZcuWOZJy+HVkgaobhJ988kk++eQTCgsLWb58OSNGjKj1j4pSioULF/L+++9z+vRpnn/+ea6//noApk+fTlJSEiUlJfTo0YMVK1YQHh5+wfq+GKUUXl5eeHl5ERAQ0Kx1na+ystIxZn99r5ycHIqKihzDhFb/6enpecHEvepnXQm+lc/Wm+GYaaZymE1RSRnrP/upxrQZ1zb/bDm4f51XPYMiODjYkO27e/05m5XqQxLzRkhNTQWMHb7oH//4B6+88go7duxwnDG/6aab6N+/P++//z4ZGRkMGjSIQYMGXfTBPwcOHODNN9/k9ddf5/7773cklNHR0UycOJG1a9c6uods27aNffv20b59e+644w7+/Oc/s3jxYv785z9TWVnJjz/+SH5+PsOGDWPAgAEMHTqUxYsXk52djb+/P/n5+fj7+5OTk8O9997LJ598QseOHcnIyOCyyy5j//79dT6CfuPGjTzxxBMcOXKE//u//+OSSy4BbG0RGxvrWC4mJsbxaPvG1GVCQgL79v36UI2ZM2fym9/8xrGNe++9l507dzrmV1ZWOobRWrlypWP6tm3bUErVaJfq7x966CEmTpzI/PnzATh79myt8mRnZzNjxgy+/PJL+vbty/Lly5k+fTq7du0C4KeffuKNN95g6dKlLFy4kL/85S+sWbOm1jrS0tK4/PLL64379OnTDBs2jIULF7JmzRoef/xxtm/fXueyISEh7N69m+3bt3PjjTc6EvMlS5bQrl07wNaF569//SuLFi2qd5tG8/DwIDAwkMDAwE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Waqx9mktziyxKqWCqh27vLBdRjb78bq5MXsp+8gN9sTiWsx/vHbW37RLrm6aKe5qx+tw4D5gmXOirMmAmA3lzO+oam0UA0wB1jYhF2kc3UJ3Pld/ASOwndb/Adhnf03EdrPa59j+S/wcaGNfvgO2/0DygBz771V35wcAp4HQi2xzIrY7cY8AT9qneQDbgR+xHezWUG2UltYYs336F9ViXg0EtfaY7fMSgfFW+fu2T38eWxetJGyX71pLvGux9Wkss3/+Tvv0/7W/LwGygM1uEPMCbAnmfmAV4FvPNu/A1g81GZhVbfpz9vVV2n8+0xpjBdpj+8L7AfgJ2/1AXq25fYFAbKOSVMW8BPBszTFXm3cU6N0SsZo1bmzHtQP2V4uMOGRgzNuAk0CR/fPj7NN/b39fju2s8jKTx7vN3j7/5QKj5lD/d3Kj45UnfwohhBBCCGEC8uRPIYQQQgghTEAScyGEEEIIIUxAEnMhhBBCCCFMQBJzIYQQQgghTEAScyGEEEIIIUxAEnMhhBBCCCFMQBJzIYQQQgghTEAScyGEEEIIIUzg/wO5na59LFbNRgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 864x576 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(figsize = (12,8))\n",
    "\n",
    "mike_blue = tuple(np.array([20, 64, 134]) / 255)\n",
    "\n",
    "tariffs_over_time = exp_trf_bynaics.groupby([\"time\"]).agg({\"tariff_trd_w_avg\": \"mean\"})\n",
    "\n",
    "ax.plot(tariffs_over_time, alpha = 0.95, color = mike_blue, linewidth = 4)\n",
    "\n",
    "#ax.plot(auto_least, alpha = 0.95, color = mike_blue, linewidth = 4, \n",
    "#        label = 'Difference between top and bottom\\nquartile of county level Chinese tariff exposure')\n",
    "\n",
    "#ax.plot(, alpha = 0.95, color = mike_blue , linewidth = 4, \n",
    "#        label = 'Bottom Quantile of Chinese Tariff Exposure Counties')\n",
    "\n",
    "ax.set_xlim(dt.datetime(2017,3,1),dt.datetime(2019,1,1))\n",
    "\n",
    "ax.spines[\"right\"].set_visible(False)\n",
    "\n",
    "ax.spines[\"top\"].set_visible(False)\n",
    "\n",
    "ax.yaxis.grid(alpha= 0.5, linestyle= \"--\")\n",
    "\n",
    "label_descrip = \"Tariff\"\n",
    "\n",
    "ax.set_ylabel(label_descrip, fontsize = 14)\n",
    "\n",
    "ax.axvline(dt.datetime(2017,4,1), linewidth = 2, ls = \"--\", color = 'k', alpha =0.15)\n",
    "\n",
    "ax.axvline(dt.datetime(2017,8,1), linewidth = 2, ls = \"--\", color = 'k', alpha =0.15)\n",
    "\n",
    "ax.axvline(dt.datetime(2018,3,1), linewidth = 2, ls = \"--\", color = 'k', alpha =0.15)\n",
    "\n",
    "ax.axvline(dt.datetime(2018,4,4), linewidth = 2, ls = \"--\", color = 'k', alpha =0.15)\n",
    "\n",
    "ax.axvline(dt.datetime(2018,7,6), linewidth = 2, ls = \"--\", color = 'k', alpha =0.15)\n",
    "\n",
    "ax.axvline(dt.datetime(2018,8,23), linewidth = 2, ls = \"--\", color = 'k', alpha =0.25)\n",
    "\n",
    "ax.axvline(dt.datetime(2018,9,24), linewidth = 2, ls = \"--\", color = 'k', alpha =0.15)\n",
    "\n",
    "ax.axvline(dt.datetime(2018,12,1), linewidth = 2, ls = \"--\", color = 'k', alpha =0.15)\n",
    "\n",
    "ax.set_title(\"Average Chinese Tariff on US Exports\", fontsize = 16, loc= \"left\" )\n",
    "\n",
    "\n",
    "##############################################################################################\n",
    "\n",
    "ax.annotate(\n",
    "    \"4/2018: US announces intention\\nto impose 301 tariffs on China\", \n",
    "    xy=(dt.datetime(2018,4,3), 7), # This is where we point at...\n",
    "    xycoords=\"data\", # Not exactly sure about this\n",
    "    xytext=(dt.datetime(2017,5,3), 8), # This is about where the text is\n",
    "    horizontalalignment=\"left\", # How the text is alined\n",
    "    arrowprops={\n",
    "        \"arrowstyle\": \"-|>\", # This is stuff about the arrow\n",
    "        \"connectionstyle\": \"angle3,angleA=0,angleB=45\",\n",
    "        \"color\": \"black\",\n",
    "        \"alpha\": 0.55\n",
    "    },\n",
    "    fontsize=11,\n",
    ")\n",
    "\n",
    "##############################################################################################\n",
    "\n",
    "ax.annotate(\n",
    "    \"7/2018: China imposes first phase of\\nretaliatory tariffs\", \n",
    "    xy=(dt.datetime(2018,7,6), 9), # This is where we point at...\n",
    "    xycoords=\"data\", # Not exactly sure about this\n",
    "    xytext=(dt.datetime(2017,6,3), 10), # This is about where the text is\n",
    "    horizontalalignment=\"left\", # How the text is alined\n",
    "    arrowprops={\n",
    "        \"arrowstyle\": \"-|>\", # This is stuff about the arrow\n",
    "        \"connectionstyle\": \"angle3,angleA=345,angleB=50\",\n",
    "        \"color\": \"black\",\n",
    "        \"alpha\": 0.55\n",
    "    },\n",
    "    fontsize=11,\n",
    ")\n",
    "\n",
    "###################################################################################\n",
    "\n",
    "ax.annotate(\n",
    "    \"8-9/2018: China imposes second and \\nthird phases of retaliatory tariffs\", \n",
    "    xy=(dt.datetime(2018,8,23), 12), color='white',# This is where we point at...\n",
    "    xycoords=\"data\", # Not exactly sure about this\n",
    "    xytext=(dt.datetime(2017,9,3), 12), # This is about where the text is\n",
    "    horizontalalignment=\"left\", # How the text is alined\n",
    "    arrowprops={\n",
    "        \"arrowstyle\": \"-|>\", # This is stuff about the arrow\n",
    "        \"connectionstyle\": \"angle3,angleA=345,angleB=80\",\n",
    "        \"color\": \"black\",\n",
    "        \"alpha\": 0.55\n",
    "    },\n",
    "    fontsize=11,\n",
    ")\n",
    "\n",
    "###################################################################################\n",
    "\n",
    "ax.annotate(\n",
    "    \"8-9/2018: China imposes second and \\nthird phases of retaliatory tariffs\", \n",
    "    xy=(dt.datetime(2018,9,24), 16), # This is where we point at...\n",
    "    xycoords=\"data\", # Not exactly sure about this\n",
    "    xytext=(dt.datetime(2017,9,3), 12), # This is about where the text is\n",
    "    horizontalalignment=\"left\", # How the text is alined\n",
    "    arrowprops={\n",
    "        \"arrowstyle\": \"-|>\", # This is stuff about the arrow\n",
    "        \"connectionstyle\": \"angle3,angleA=3,angleB=36\",\n",
    "        \"color\": \"black\",\n",
    "        \"alpha\": 0.55\n",
    "    },\n",
    "    fontsize=11,\n",
    ")\n",
    "\n",
    "##############################################################################################\n",
    "\n",
    "\n",
    "##############################################################################################\n",
    "\n",
    "#\n",
    "\n",
    "if not os.path.exists(fig_path):\n",
    "    os.makedirs(fig_path)\n",
    "    \n",
    "plt.savefig(fig_path + \"\\\\tariffs_time.pdf\", bbox_inches = \"tight\", dip = 3600)\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This simple plot looks a lot like the Bowen figures. Note that the dip is all about China changing their MFN tariffs in (what appears to be) certain consumer orinted catagories as Bowen point out. So clothing stuff falls, while they are hammering the ag. products. \n",
    "\n",
    "Looks like we accomplished this task. Just a couple of things to clean up then we are ready to move onto the next step. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [],
   "source": [
    "exp_trf_bynaics[\"time\"] = exp_trf_bynaics.index.get_level_values(0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [],
   "source": [
    "exp_trf_bynaics = exp_trf_bynaics.droplevel(level=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>tariff_trd_w_avg</th>\n",
       "      <th>total_trade</th>\n",
       "      <th>china_trade</th>\n",
       "      <th>time</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>naics3</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.731278</td>\n",
       "      <td>6.628535e+09</td>\n",
       "      <td>2.260464e+09</td>\n",
       "      <td>2015-01-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738917</td>\n",
       "      <td>5.939264e+09</td>\n",
       "      <td>1.496540e+09</td>\n",
       "      <td>2015-02-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738919</td>\n",
       "      <td>5.772844e+09</td>\n",
       "      <td>1.079484e+09</td>\n",
       "      <td>2015-03-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738919</td>\n",
       "      <td>4.840803e+09</td>\n",
       "      <td>6.281327e+08</td>\n",
       "      <td>2015-04-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738919</td>\n",
       "      <td>4.459799e+09</td>\n",
       "      <td>3.796146e+08</td>\n",
       "      <td>2015-05-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738922</td>\n",
       "      <td>3.940733e+09</td>\n",
       "      <td>2.350021e+08</td>\n",
       "      <td>2015-06-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738922</td>\n",
       "      <td>3.971715e+09</td>\n",
       "      <td>3.364084e+08</td>\n",
       "      <td>2015-07-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738922</td>\n",
       "      <td>3.840239e+09</td>\n",
       "      <td>2.713938e+08</td>\n",
       "      <td>2015-08-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738922</td>\n",
       "      <td>4.195234e+09</td>\n",
       "      <td>7.404528e+08</td>\n",
       "      <td>2015-09-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738922</td>\n",
       "      <td>6.861187e+09</td>\n",
       "      <td>3.062933e+09</td>\n",
       "      <td>2015-10-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738922</td>\n",
       "      <td>6.723856e+09</td>\n",
       "      <td>2.708202e+09</td>\n",
       "      <td>2015-11-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738922</td>\n",
       "      <td>5.794155e+09</td>\n",
       "      <td>1.700793e+09</td>\n",
       "      <td>2015-12-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738919</td>\n",
       "      <td>5.275188e+09</td>\n",
       "      <td>1.613464e+09</td>\n",
       "      <td>2016-01-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738919</td>\n",
       "      <td>5.555438e+09</td>\n",
       "      <td>1.459631e+09</td>\n",
       "      <td>2016-02-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738919</td>\n",
       "      <td>4.854742e+09</td>\n",
       "      <td>6.940692e+08</td>\n",
       "      <td>2016-03-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738919</td>\n",
       "      <td>4.171127e+09</td>\n",
       "      <td>3.014534e+08</td>\n",
       "      <td>2016-04-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738919</td>\n",
       "      <td>3.990587e+09</td>\n",
       "      <td>2.322465e+08</td>\n",
       "      <td>2016-05-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738919</td>\n",
       "      <td>4.393065e+09</td>\n",
       "      <td>2.820437e+08</td>\n",
       "      <td>2016-06-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738919</td>\n",
       "      <td>4.862743e+09</td>\n",
       "      <td>7.284129e+08</td>\n",
       "      <td>2016-07-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738919</td>\n",
       "      <td>5.443956e+09</td>\n",
       "      <td>1.046437e+09</td>\n",
       "      <td>2016-08-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738919</td>\n",
       "      <td>5.326267e+09</td>\n",
       "      <td>1.177917e+09</td>\n",
       "      <td>2016-09-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738919</td>\n",
       "      <td>8.232309e+09</td>\n",
       "      <td>3.622939e+09</td>\n",
       "      <td>2016-10-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738919</td>\n",
       "      <td>8.310276e+09</td>\n",
       "      <td>3.428755e+09</td>\n",
       "      <td>2016-11-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738919</td>\n",
       "      <td>7.209860e+09</td>\n",
       "      <td>2.680096e+09</td>\n",
       "      <td>2016-12-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738953</td>\n",
       "      <td>6.619171e+09</td>\n",
       "      <td>2.110695e+09</td>\n",
       "      <td>2017-01-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738953</td>\n",
       "      <td>6.084644e+09</td>\n",
       "      <td>1.366946e+09</td>\n",
       "      <td>2017-02-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738953</td>\n",
       "      <td>6.301076e+09</td>\n",
       "      <td>9.569031e+08</td>\n",
       "      <td>2017-03-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738953</td>\n",
       "      <td>5.227715e+09</td>\n",
       "      <td>5.743821e+08</td>\n",
       "      <td>2017-04-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738953</td>\n",
       "      <td>4.828126e+09</td>\n",
       "      <td>4.453909e+08</td>\n",
       "      <td>2017-05-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738953</td>\n",
       "      <td>4.631361e+09</td>\n",
       "      <td>3.614239e+08</td>\n",
       "      <td>2017-06-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738953</td>\n",
       "      <td>4.734344e+09</td>\n",
       "      <td>5.628932e+08</td>\n",
       "      <td>2017-07-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738953</td>\n",
       "      <td>4.361836e+09</td>\n",
       "      <td>7.076222e+08</td>\n",
       "      <td>2017-08-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738953</td>\n",
       "      <td>4.930351e+09</td>\n",
       "      <td>1.280538e+09</td>\n",
       "      <td>2017-09-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738953</td>\n",
       "      <td>7.063994e+09</td>\n",
       "      <td>2.835574e+09</td>\n",
       "      <td>2017-10-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738956</td>\n",
       "      <td>7.429730e+09</td>\n",
       "      <td>2.729259e+09</td>\n",
       "      <td>2017-11-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738956</td>\n",
       "      <td>6.631293e+09</td>\n",
       "      <td>1.853807e+09</td>\n",
       "      <td>2017-12-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738951</td>\n",
       "      <td>6.044481e+09</td>\n",
       "      <td>1.580785e+09</td>\n",
       "      <td>2018-01-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738953</td>\n",
       "      <td>5.822961e+09</td>\n",
       "      <td>1.216212e+09</td>\n",
       "      <td>2018-02-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>7.738953</td>\n",
       "      <td>6.475432e+09</td>\n",
       "      <td>9.740110e+08</td>\n",
       "      <td>2018-03-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>8.179163</td>\n",
       "      <td>5.738977e+09</td>\n",
       "      <td>5.471887e+08</td>\n",
       "      <td>2018-04-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>8.179163</td>\n",
       "      <td>5.860629e+09</td>\n",
       "      <td>4.036247e+08</td>\n",
       "      <td>2018-05-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>8.179163</td>\n",
       "      <td>5.457883e+09</td>\n",
       "      <td>2.374020e+08</td>\n",
       "      <td>2018-06-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>32.810320</td>\n",
       "      <td>5.214014e+09</td>\n",
       "      <td>1.942874e+08</td>\n",
       "      <td>2018-07-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>32.810320</td>\n",
       "      <td>4.703210e+09</td>\n",
       "      <td>1.337902e+08</td>\n",
       "      <td>2018-08-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>32.810320</td>\n",
       "      <td>4.545622e+09</td>\n",
       "      <td>8.415142e+07</td>\n",
       "      <td>2018-09-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>5.923309e+09</td>\n",
       "      <td>1.827318e+08</td>\n",
       "      <td>2018-10-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>5.934294e+09</td>\n",
       "      <td>1.314118e+08</td>\n",
       "      <td>2018-11-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>5.539082e+09</td>\n",
       "      <td>1.738748e+08</td>\n",
       "      <td>2018-12-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>32.842474</td>\n",
       "      <td>5.741959e+09</td>\n",
       "      <td>5.641075e+08</td>\n",
       "      <td>2019-01-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>32.843840</td>\n",
       "      <td>5.582659e+09</td>\n",
       "      <td>8.585226e+08</td>\n",
       "      <td>2019-02-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>32.843841</td>\n",
       "      <td>5.813037e+09</td>\n",
       "      <td>6.457830e+08</td>\n",
       "      <td>2019-03-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>32.843841</td>\n",
       "      <td>5.197778e+09</td>\n",
       "      <td>3.649107e+08</td>\n",
       "      <td>2019-04-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>32.843841</td>\n",
       "      <td>5.114133e+09</td>\n",
       "      <td>6.626260e+08</td>\n",
       "      <td>2019-05-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>4.850459e+09</td>\n",
       "      <td>8.207336e+08</td>\n",
       "      <td>2019-06-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>4.813673e+09</td>\n",
       "      <td>8.472533e+08</td>\n",
       "      <td>2019-07-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>5.001523e+09</td>\n",
       "      <td>1.103263e+09</td>\n",
       "      <td>2019-08-01</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        tariff_trd_w_avg   total_trade   china_trade       time\n",
       "naics3                                                         \n",
       "111             7.731278  6.628535e+09  2.260464e+09 2015-01-01\n",
       "111             7.738917  5.939264e+09  1.496540e+09 2015-02-01\n",
       "111             7.738919  5.772844e+09  1.079484e+09 2015-03-01\n",
       "111             7.738919  4.840803e+09  6.281327e+08 2015-04-01\n",
       "111             7.738919  4.459799e+09  3.796146e+08 2015-05-01\n",
       "111             7.738922  3.940733e+09  2.350021e+08 2015-06-01\n",
       "111             7.738922  3.971715e+09  3.364084e+08 2015-07-01\n",
       "111             7.738922  3.840239e+09  2.713938e+08 2015-08-01\n",
       "111             7.738922  4.195234e+09  7.404528e+08 2015-09-01\n",
       "111             7.738922  6.861187e+09  3.062933e+09 2015-10-01\n",
       "111             7.738922  6.723856e+09  2.708202e+09 2015-11-01\n",
       "111             7.738922  5.794155e+09  1.700793e+09 2015-12-01\n",
       "111             7.738919  5.275188e+09  1.613464e+09 2016-01-01\n",
       "111             7.738919  5.555438e+09  1.459631e+09 2016-02-01\n",
       "111             7.738919  4.854742e+09  6.940692e+08 2016-03-01\n",
       "111             7.738919  4.171127e+09  3.014534e+08 2016-04-01\n",
       "111             7.738919  3.990587e+09  2.322465e+08 2016-05-01\n",
       "111             7.738919  4.393065e+09  2.820437e+08 2016-06-01\n",
       "111             7.738919  4.862743e+09  7.284129e+08 2016-07-01\n",
       "111             7.738919  5.443956e+09  1.046437e+09 2016-08-01\n",
       "111             7.738919  5.326267e+09  1.177917e+09 2016-09-01\n",
       "111             7.738919  8.232309e+09  3.622939e+09 2016-10-01\n",
       "111             7.738919  8.310276e+09  3.428755e+09 2016-11-01\n",
       "111             7.738919  7.209860e+09  2.680096e+09 2016-12-01\n",
       "111             7.738953  6.619171e+09  2.110695e+09 2017-01-01\n",
       "111             7.738953  6.084644e+09  1.366946e+09 2017-02-01\n",
       "111             7.738953  6.301076e+09  9.569031e+08 2017-03-01\n",
       "111             7.738953  5.227715e+09  5.743821e+08 2017-04-01\n",
       "111             7.738953  4.828126e+09  4.453909e+08 2017-05-01\n",
       "111             7.738953  4.631361e+09  3.614239e+08 2017-06-01\n",
       "111             7.738953  4.734344e+09  5.628932e+08 2017-07-01\n",
       "111             7.738953  4.361836e+09  7.076222e+08 2017-08-01\n",
       "111             7.738953  4.930351e+09  1.280538e+09 2017-09-01\n",
       "111             7.738953  7.063994e+09  2.835574e+09 2017-10-01\n",
       "111             7.738956  7.429730e+09  2.729259e+09 2017-11-01\n",
       "111             7.738956  6.631293e+09  1.853807e+09 2017-12-01\n",
       "111             7.738951  6.044481e+09  1.580785e+09 2018-01-01\n",
       "111             7.738953  5.822961e+09  1.216212e+09 2018-02-01\n",
       "111             7.738953  6.475432e+09  9.740110e+08 2018-03-01\n",
       "111             8.179163  5.738977e+09  5.471887e+08 2018-04-01\n",
       "111             8.179163  5.860629e+09  4.036247e+08 2018-05-01\n",
       "111             8.179163  5.457883e+09  2.374020e+08 2018-06-01\n",
       "111            32.810320  5.214014e+09  1.942874e+08 2018-07-01\n",
       "111            32.810320  4.703210e+09  1.337902e+08 2018-08-01\n",
       "111            32.810320  4.545622e+09  8.415142e+07 2018-09-01\n",
       "111            32.843688  5.923309e+09  1.827318e+08 2018-10-01\n",
       "111            32.843688  5.934294e+09  1.314118e+08 2018-11-01\n",
       "111            32.843688  5.539082e+09  1.738748e+08 2018-12-01\n",
       "111            32.842474  5.741959e+09  5.641075e+08 2019-01-01\n",
       "111            32.843840  5.582659e+09  8.585226e+08 2019-02-01\n",
       "111            32.843841  5.813037e+09  6.457830e+08 2019-03-01\n",
       "111            32.843841  5.197778e+09  3.649107e+08 2019-04-01\n",
       "111            32.843841  5.114133e+09  6.626260e+08 2019-05-01\n",
       "111            32.843688  4.850459e+09  8.207336e+08 2019-06-01\n",
       "111            32.843688  4.813673e+09  8.472533e+08 2019-07-01\n",
       "111            32.843688  5.001523e+09  1.103263e+09 2019-08-01"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "exp_trf_bynaics.loc[\"111\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "### Step 3 Merge trade data with the county data\n",
    "\n",
    "This is the most time consuming step (interms of compuation time). So start with the county data set, `groupby` county, then apply a function which will create (i) time varying exports (which are constructed with the 2017 weightes) and (ii) time varying tariffs (also constructed using the 2017) weights. \n",
    "\n",
    "The final want is a big dataframe that has county, time, export exposure and tariff exposure. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(\"\")\n",
    "print(\"**********************************************************************************\")\n",
    "print(\"Constructing County-Level Tariffs and Exports\")\n",
    "print(\"\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [],
   "source": [
    "grp = df_county.groupby(\"area_fips\")\n",
    "\n",
    "# This creates groups at the county level."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>area_fips</th>\n",
       "      <th>own_code</th>\n",
       "      <th>industry_code</th>\n",
       "      <th>agglvl_code</th>\n",
       "      <th>size_code</th>\n",
       "      <th>year</th>\n",
       "      <th>disclosure_code</th>\n",
       "      <th>annual_avg_estabs</th>\n",
       "      <th>annual_avg_emplvl</th>\n",
       "      <th>total_annual_wages</th>\n",
       "      <th>avg_annual_pay</th>\n",
       "      <th>sup_ind</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>3016</td>\n",
       "      <td>1001</td>\n",
       "      <td>5</td>\n",
       "      <td>111</td>\n",
       "      <td>75</td>\n",
       "      <td>0</td>\n",
       "      <td>2017</td>\n",
       "      <td>N</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3026</td>\n",
       "      <td>1001</td>\n",
       "      <td>5</td>\n",
       "      <td>112</td>\n",
       "      <td>75</td>\n",
       "      <td>0</td>\n",
       "      <td>2017</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3</td>\n",
       "      <td>27</td>\n",
       "      <td>848146</td>\n",
       "      <td>31905</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3033</td>\n",
       "      <td>1001</td>\n",
       "      <td>5</td>\n",
       "      <td>113</td>\n",
       "      <td>75</td>\n",
       "      <td>0</td>\n",
       "      <td>2017</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4</td>\n",
       "      <td>36</td>\n",
       "      <td>2901165</td>\n",
       "      <td>80032</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3040</td>\n",
       "      <td>1001</td>\n",
       "      <td>5</td>\n",
       "      <td>115</td>\n",
       "      <td>75</td>\n",
       "      <td>0</td>\n",
       "      <td>2017</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9</td>\n",
       "      <td>27</td>\n",
       "      <td>2007731</td>\n",
       "      <td>74132</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3052</td>\n",
       "      <td>1001</td>\n",
       "      <td>5</td>\n",
       "      <td>212</td>\n",
       "      <td>75</td>\n",
       "      <td>0</td>\n",
       "      <td>2017</td>\n",
       "      <td>N</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     area_fips  own_code industry_code  agglvl_code  size_code  year  \\\n",
       "3016      1001         5           111           75          0  2017   \n",
       "3026      1001         5           112           75          0  2017   \n",
       "3033      1001         5           113           75          0  2017   \n",
       "3040      1001         5           115           75          0  2017   \n",
       "3052      1001         5           212           75          0  2017   \n",
       "\n",
       "     disclosure_code  annual_avg_estabs  annual_avg_emplvl  \\\n",
       "3016               N                  4                  0   \n",
       "3026             NaN                  3                 27   \n",
       "3033             NaN                  4                 36   \n",
       "3040             NaN                  9                 27   \n",
       "3052               N                  4                  0   \n",
       "\n",
       "      total_annual_wages  avg_annual_pay  sup_ind  \n",
       "3016                   0               0        1  \n",
       "3026              848146           31905        1  \n",
       "3033             2901165           80032        1  \n",
       "3040             2007731           74132        1  \n",
       "3052                   0               0        1  "
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Let's just look at one of the groups...\n",
    "\n",
    "grp.get_group(\"1001\").head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Below are the two key functions that deliver this. Basically it does the following: \n",
    "\n",
    "- Take a group at county level, merge it with the national level data set, so the resulting `df` has the county and nation.\n",
    "\n",
    "- Create the weights. \n",
    "\n",
    "- Then merge it with the exports, this will now be a df with exports varying over time, but with the fixed weights associated with each entry.\n",
    "\n",
    "- Then aggregate the national exports by NAICS by the county level weights, giving a county level time series of exports.\n",
    "\n",
    "---\n",
    "\n",
    "**Updates**\n",
    "\n",
    "- The tariff measure does the following: fix a county, take employment in industry $i$ and divide by total county employment, then sum up tariffs across industries with the weights being the county level share. The idea here is if all employment in a county is soy, then the \"effective\" tariff that the county faces is the soy tariff.\n",
    "\n",
    "In equation terms: here $c$ is county, $s$ is industry, $n$, below is nation.\n",
    "\n",
    "$\\tau_{c,t} = \\sum_{s\\in S}\\frac{L_{c,s}}{L_{c,S}} \\tau_{s,t}$\n",
    "\n",
    "Note that below, I make one further adjustment to make sure that $L_{c,S}$ is for all employment, not just the sum across $L_{c,s}$\n",
    "\n",
    "\n",
    "- The export measure: What am I doing: take a county's employment in industry $i$ and divide by **national** level employment in industry $i$. Then a \"county's\" exports is the the sum across industries, weighted by the county's share of national employment in each industry. The idea here is, if a county's has all national level employment in an industry, all that industries exports will be assigned to that county.\n",
    "\n",
    "$\\mbox{EX}_{c,t} = \\frac{1}{L_{c,S,2017}}\\sum_{s\\in S}\\frac{L_{c,s,2017}}{L_{n,s,2017}} \\mbox{EX}_{s,t}$\n",
    "\n",
    "and then I divide by total employment in the county to have a county per worker measure. This is done for exports to China and then export in total. Note that below, I make one further adjustment to make sure that $L_{c,S}$ is for all employment, not just the sum across $L_{c,s}$\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [],
   "source": [
    "def create_trade_weights(df):\n",
    "    # Takes in the county groupings and will return, for each county, a time series of export\n",
    "    # exposure, tariffs, and other statistics. \n",
    "\n",
    "    new_df = df.merge(df_national[[\"nat_emplvl\",\n",
    "                                   \"industry_code\", \"trd_wts\"]],\n",
    "                                  how = \"outer\", left_on = \"industry_code\", right_on = \"industry_code\")\n",
    "    # Merge the nation with the county, why, we want to make sure all the naics codes are lined up properly\n",
    "        \n",
    "    new_df[\"emp_wts\"] = (new_df.annual_avg_emplvl/new_df.nat_emplvl)\n",
    "     \n",
    "    # create the weights...\n",
    "        \n",
    "    foo_df = exp_trf_bynaics.merge(new_df[[\"emp_wts\",\"trd_wts\",\n",
    "                                           \"industry_code\",\n",
    "                                          \"annual_avg_emplvl\"]], left_index = True, right_on = \"industry_code\")  \n",
    "    \n",
    "    # Now each weight is for a NAICS code, we will merge it with the export trade data set, so for all naics, all time...\n",
    "    # This is a big df whith all trade data and then the county's weights for each naics code\n",
    "    \n",
    "    foo_grp = foo_df.groupby(\"time\")\n",
    "    \n",
    "    # group by time. \n",
    "    \n",
    "    foo = foo_grp.apply(trade_by_naics)\n",
    "    \n",
    "    # Then for each time gropuing, we aggregate across the naics codes according to the weights above.\n",
    "    \n",
    "    foo = foo.droplevel(1)\n",
    "    \n",
    "    foo[\"fips\"] = df[\"area_fips\"].astype(str).iloc[0]\n",
    "    \n",
    "    # some cleaning of the df\n",
    "    \n",
    "    foo[\"total_employment\"] = new_df.annual_avg_emplvl.sum()\n",
    "    \n",
    "    # get total employment.\n",
    "    \n",
    "    return pd.DataFrame(foo)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [],
   "source": [
    "def trade_by_naics(df):\n",
    "    # Simple function just to test about aggregation \n",
    "\n",
    "    china_exp_pc = (1/df[\"annual_avg_emplvl\"].sum())*(df[\"china_trade\"]*df[\"emp_wts\"]).sum()\n",
    "    \n",
    "    total_exp_pc = (1/df[\"annual_avg_emplvl\"].sum())*(df[\"total_trade\"]*df[\"emp_wts\"]).sum()\n",
    "    # the first term multiplies trade by the county's share of national level employment\n",
    "    # then the outside term divides by number of workers in a county. \n",
    "    \n",
    "    #tariff_nwt_pc = (1/df[\"annual_avg_emplvl\"].sum())*(df[\"tariff_trd_w_avg\"]*df[\"emp_wts\"]).sum()\n",
    "    # This is the measure that makes most sense, need to justify it...\n",
    "    tariff =  ((df[\"annual_avg_emplvl\"]*df[\"tariff_trd_w_avg\"])/df[\"annual_avg_emplvl\"].sum()).sum()\n",
    "    # local employment share weighted tariff. So if all guys are in area are working in soy,\n",
    "    # then they are facing the soybean tariff....\n",
    "    \n",
    "    foo = {\"total_exp_pc\": [total_exp_pc],\n",
    "          \"china_exp_pc\": [china_exp_pc],\n",
    "           \"tariff\": [tariff],\n",
    "          \"emplvl_2017\": df[\"annual_avg_emplvl\"].sum()}\n",
    "\n",
    "    return pd.DataFrame(foo)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Then apply the function to the county groups"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:4: RuntimeWarning: divide by zero encountered in double_scalars\n",
      "  after removing the cwd from sys.path.\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:4: RuntimeWarning: invalid value encountered in double_scalars\n",
      "  after removing the cwd from sys.path.\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:6: RuntimeWarning: divide by zero encountered in double_scalars\n",
      "  \n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:6: RuntimeWarning: invalid value encountered in double_scalars\n",
      "  \n"
     ]
    }
   ],
   "source": [
    "trade_county = grp.apply(create_trade_weights)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "And we are done and output the file to where we want it"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>total_exp_pc</th>\n",
       "      <th>china_exp_pc</th>\n",
       "      <th>tariff</th>\n",
       "      <th>emplvl_2017</th>\n",
       "      <th>fips</th>\n",
       "      <th>total_employment</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>area_fips</th>\n",
       "      <th>time</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td rowspan=\"3\" valign=\"top\">53023</td>\n",
       "      <td>2019-03-01</td>\n",
       "      <td>10871.646688</td>\n",
       "      <td>1207.755065</td>\n",
       "      <td>32.843841</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-04-01</td>\n",
       "      <td>9720.978332</td>\n",
       "      <td>682.462529</td>\n",
       "      <td>32.843841</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-05-01</td>\n",
       "      <td>9564.543414</td>\n",
       "      <td>1239.255085</td>\n",
       "      <td>32.843841</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td rowspan=\"3\" valign=\"top\">28055</td>\n",
       "      <td>2019-03-01</td>\n",
       "      <td>10871.646688</td>\n",
       "      <td>1207.755065</td>\n",
       "      <td>32.843841</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-04-01</td>\n",
       "      <td>9720.978332</td>\n",
       "      <td>682.462529</td>\n",
       "      <td>32.843841</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-05-01</td>\n",
       "      <td>9564.543414</td>\n",
       "      <td>1239.255085</td>\n",
       "      <td>32.843841</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>53023</td>\n",
       "      <td>2019-02-01</td>\n",
       "      <td>10440.790650</td>\n",
       "      <td>1605.624408</td>\n",
       "      <td>32.843840</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>28055</td>\n",
       "      <td>2019-02-01</td>\n",
       "      <td>10440.790650</td>\n",
       "      <td>1605.624408</td>\n",
       "      <td>32.843840</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td rowspan=\"6\" valign=\"top\">53023</td>\n",
       "      <td>2018-10-01</td>\n",
       "      <td>11077.880433</td>\n",
       "      <td>341.748327</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-11-01</td>\n",
       "      <td>11098.423631</td>\n",
       "      <td>245.768800</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-12-01</td>\n",
       "      <td>10359.291167</td>\n",
       "      <td>325.183876</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-06-01</td>\n",
       "      <td>9071.415764</td>\n",
       "      <td>1534.950789</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-07-01</td>\n",
       "      <td>9002.619207</td>\n",
       "      <td>1584.548413</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>9353.938784</td>\n",
       "      <td>2063.342059</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td rowspan=\"6\" valign=\"top\">28055</td>\n",
       "      <td>2018-10-01</td>\n",
       "      <td>11077.880433</td>\n",
       "      <td>341.748327</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-11-01</td>\n",
       "      <td>11098.423631</td>\n",
       "      <td>245.768800</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-12-01</td>\n",
       "      <td>10359.291167</td>\n",
       "      <td>325.183876</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-06-01</td>\n",
       "      <td>9071.415764</td>\n",
       "      <td>1534.950789</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-07-01</td>\n",
       "      <td>9002.619207</td>\n",
       "      <td>1584.548413</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>9353.938784</td>\n",
       "      <td>2063.342059</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>53023</td>\n",
       "      <td>2019-01-01</td>\n",
       "      <td>10738.715609</td>\n",
       "      <td>1055.003978</td>\n",
       "      <td>32.842474</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>28055</td>\n",
       "      <td>2019-01-01</td>\n",
       "      <td>10738.715609</td>\n",
       "      <td>1055.003978</td>\n",
       "      <td>32.842474</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td rowspan=\"3\" valign=\"top\">53023</td>\n",
       "      <td>2018-07-01</td>\n",
       "      <td>9751.343396</td>\n",
       "      <td>363.359785</td>\n",
       "      <td>32.810320</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>8796.029329</td>\n",
       "      <td>250.216820</td>\n",
       "      <td>32.810320</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-09-01</td>\n",
       "      <td>8501.304814</td>\n",
       "      <td>157.381511</td>\n",
       "      <td>32.810320</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                      total_exp_pc  china_exp_pc     tariff  emplvl_2017  \\\n",
       "area_fips time                                                             \n",
       "53023     2019-03-01  10871.646688   1207.755065  32.843841         37.0   \n",
       "          2019-04-01   9720.978332    682.462529  32.843841         37.0   \n",
       "          2019-05-01   9564.543414   1239.255085  32.843841         37.0   \n",
       "28055     2019-03-01  10871.646688   1207.755065  32.843841         21.0   \n",
       "          2019-04-01   9720.978332    682.462529  32.843841         21.0   \n",
       "          2019-05-01   9564.543414   1239.255085  32.843841         21.0   \n",
       "53023     2019-02-01  10440.790650   1605.624408  32.843840         37.0   \n",
       "28055     2019-02-01  10440.790650   1605.624408  32.843840         21.0   \n",
       "53023     2018-10-01  11077.880433    341.748327  32.843688         37.0   \n",
       "          2018-11-01  11098.423631    245.768800  32.843688         37.0   \n",
       "          2018-12-01  10359.291167    325.183876  32.843688         37.0   \n",
       "          2019-06-01   9071.415764   1534.950789  32.843688         37.0   \n",
       "          2019-07-01   9002.619207   1584.548413  32.843688         37.0   \n",
       "          2019-08-01   9353.938784   2063.342059  32.843688         37.0   \n",
       "28055     2018-10-01  11077.880433    341.748327  32.843688         21.0   \n",
       "          2018-11-01  11098.423631    245.768800  32.843688         21.0   \n",
       "          2018-12-01  10359.291167    325.183876  32.843688         21.0   \n",
       "          2019-06-01   9071.415764   1534.950789  32.843688         21.0   \n",
       "          2019-07-01   9002.619207   1584.548413  32.843688         21.0   \n",
       "          2019-08-01   9353.938784   2063.342059  32.843688         21.0   \n",
       "53023     2019-01-01  10738.715609   1055.003978  32.842474         37.0   \n",
       "28055     2019-01-01  10738.715609   1055.003978  32.842474         21.0   \n",
       "53023     2018-07-01   9751.343396    363.359785  32.810320         37.0   \n",
       "          2018-08-01   8796.029329    250.216820  32.810320         37.0   \n",
       "          2018-09-01   8501.304814    157.381511  32.810320         37.0   \n",
       "\n",
       "                       fips  total_employment  \n",
       "area_fips time                                 \n",
       "53023     2019-03-01  53023              37.0  \n",
       "          2019-04-01  53023              37.0  \n",
       "          2019-05-01  53023              37.0  \n",
       "28055     2019-03-01  28055              21.0  \n",
       "          2019-04-01  28055              21.0  \n",
       "          2019-05-01  28055              21.0  \n",
       "53023     2019-02-01  53023              37.0  \n",
       "28055     2019-02-01  28055              21.0  \n",
       "53023     2018-10-01  53023              37.0  \n",
       "          2018-11-01  53023              37.0  \n",
       "          2018-12-01  53023              37.0  \n",
       "          2019-06-01  53023              37.0  \n",
       "          2019-07-01  53023              37.0  \n",
       "          2019-08-01  53023              37.0  \n",
       "28055     2018-10-01  28055              21.0  \n",
       "          2018-11-01  28055              21.0  \n",
       "          2018-12-01  28055              21.0  \n",
       "          2019-06-01  28055              21.0  \n",
       "          2019-07-01  28055              21.0  \n",
       "          2019-08-01  28055              21.0  \n",
       "53023     2019-01-01  53023              37.0  \n",
       "28055     2019-01-01  28055              21.0  \n",
       "53023     2018-07-01  53023              37.0  \n",
       "          2018-08-01  53023              37.0  \n",
       "          2018-09-01  53023              37.0  "
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "trade_county.sort_values(by = [\"tariff\",\"emplvl_2017\"], ascending = False).head(25)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**One more adjustment.** Notice that in the function, when we are merging, we are droping all the NAICS codes without trade. So these measures (total trade, china trade, and tariffs) are only conditional on being traded. This only matters in so far as the denominator, the ``df[\"annual_avg_emplvl\"].sum()`` is concerned. \n",
    "\n",
    "To make the adjustment then, we multiply the employment measure in the denominator and then divide through by the ``total_employment`` measure. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [],
   "source": [
    "trade_county[\"tariff\"] = (trade_county[\"emplvl_2017\"]/\n",
    "                              trade_county[\"total_employment\"])*trade_county[\"tariff\"]\n",
    "\n",
    "trade_county[\"china_exp_pc\"] = (trade_county[\"emplvl_2017\"]/\n",
    "                                    trade_county[\"total_employment\"])*trade_county[\"china_exp_pc\"]\n",
    "\n",
    "trade_county[\"total_exp_pc\"] = (trade_county[\"emplvl_2017\"]/\n",
    "                                    trade_county[\"total_employment\"])*trade_county[\"total_exp_pc\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:\\\\github\\\\consumption_and_tradewar'"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.getcwd()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [],
   "source": [
    "file_path = os.getcwd() + \"\\\\data\"+ \"\\\\total_trade_data_2015.parquet\"\n",
    "\n",
    "pq.write_table(pa.Table.from_pandas(trade_county.reset_index()), file_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>total_exp_pc</th>\n",
       "      <th>china_exp_pc</th>\n",
       "      <th>tariff</th>\n",
       "      <th>emplvl_2017</th>\n",
       "      <th>fips</th>\n",
       "      <th>total_employment</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>area_fips</th>\n",
       "      <th>time</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td rowspan=\"3\" valign=\"top\">53023</td>\n",
       "      <td>2019-03-01</td>\n",
       "      <td>10871.646688</td>\n",
       "      <td>1207.755065</td>\n",
       "      <td>32.843841</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-04-01</td>\n",
       "      <td>9720.978332</td>\n",
       "      <td>682.462529</td>\n",
       "      <td>32.843841</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-05-01</td>\n",
       "      <td>9564.543414</td>\n",
       "      <td>1239.255085</td>\n",
       "      <td>32.843841</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td rowspan=\"3\" valign=\"top\">28055</td>\n",
       "      <td>2019-03-01</td>\n",
       "      <td>10871.646688</td>\n",
       "      <td>1207.755065</td>\n",
       "      <td>32.843841</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-04-01</td>\n",
       "      <td>9720.978332</td>\n",
       "      <td>682.462529</td>\n",
       "      <td>32.843841</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-05-01</td>\n",
       "      <td>9564.543414</td>\n",
       "      <td>1239.255085</td>\n",
       "      <td>32.843841</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>53023</td>\n",
       "      <td>2019-02-01</td>\n",
       "      <td>10440.790650</td>\n",
       "      <td>1605.624408</td>\n",
       "      <td>32.843840</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>28055</td>\n",
       "      <td>2019-02-01</td>\n",
       "      <td>10440.790650</td>\n",
       "      <td>1605.624408</td>\n",
       "      <td>32.843840</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td rowspan=\"6\" valign=\"top\">53023</td>\n",
       "      <td>2018-10-01</td>\n",
       "      <td>11077.880433</td>\n",
       "      <td>341.748327</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-11-01</td>\n",
       "      <td>11098.423631</td>\n",
       "      <td>245.768800</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-12-01</td>\n",
       "      <td>10359.291167</td>\n",
       "      <td>325.183876</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-06-01</td>\n",
       "      <td>9071.415764</td>\n",
       "      <td>1534.950789</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-07-01</td>\n",
       "      <td>9002.619207</td>\n",
       "      <td>1584.548413</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>9353.938784</td>\n",
       "      <td>2063.342059</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td rowspan=\"6\" valign=\"top\">28055</td>\n",
       "      <td>2018-10-01</td>\n",
       "      <td>11077.880433</td>\n",
       "      <td>341.748327</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-11-01</td>\n",
       "      <td>11098.423631</td>\n",
       "      <td>245.768800</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-12-01</td>\n",
       "      <td>10359.291167</td>\n",
       "      <td>325.183876</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-06-01</td>\n",
       "      <td>9071.415764</td>\n",
       "      <td>1534.950789</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-07-01</td>\n",
       "      <td>9002.619207</td>\n",
       "      <td>1584.548413</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>9353.938784</td>\n",
       "      <td>2063.342059</td>\n",
       "      <td>32.843688</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>53023</td>\n",
       "      <td>2019-01-01</td>\n",
       "      <td>10738.715609</td>\n",
       "      <td>1055.003978</td>\n",
       "      <td>32.842474</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>28055</td>\n",
       "      <td>2019-01-01</td>\n",
       "      <td>10738.715609</td>\n",
       "      <td>1055.003978</td>\n",
       "      <td>32.842474</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td rowspan=\"3\" valign=\"top\">53023</td>\n",
       "      <td>2018-07-01</td>\n",
       "      <td>9751.343396</td>\n",
       "      <td>363.359785</td>\n",
       "      <td>32.810320</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>8796.029329</td>\n",
       "      <td>250.216820</td>\n",
       "      <td>32.810320</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-09-01</td>\n",
       "      <td>8501.304814</td>\n",
       "      <td>157.381511</td>\n",
       "      <td>32.810320</td>\n",
       "      <td>37.0</td>\n",
       "      <td>53023</td>\n",
       "      <td>37.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td rowspan=\"3\" valign=\"top\">28055</td>\n",
       "      <td>2018-07-01</td>\n",
       "      <td>9751.343396</td>\n",
       "      <td>363.359785</td>\n",
       "      <td>32.810320</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>8796.029329</td>\n",
       "      <td>250.216820</td>\n",
       "      <td>32.810320</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-09-01</td>\n",
       "      <td>8501.304814</td>\n",
       "      <td>157.381511</td>\n",
       "      <td>32.810320</td>\n",
       "      <td>21.0</td>\n",
       "      <td>28055</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td rowspan=\"14\" valign=\"top\">48229</td>\n",
       "      <td>2019-03-01</td>\n",
       "      <td>9958.760325</td>\n",
       "      <td>1106.340518</td>\n",
       "      <td>30.085961</td>\n",
       "      <td>120.0</td>\n",
       "      <td>48229</td>\n",
       "      <td>131.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-04-01</td>\n",
       "      <td>8904.712976</td>\n",
       "      <td>625.156515</td>\n",
       "      <td>30.085961</td>\n",
       "      <td>120.0</td>\n",
       "      <td>48229</td>\n",
       "      <td>131.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-05-01</td>\n",
       "      <td>8761.413815</td>\n",
       "      <td>1135.195497</td>\n",
       "      <td>30.085961</td>\n",
       "      <td>120.0</td>\n",
       "      <td>48229</td>\n",
       "      <td>131.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-02-01</td>\n",
       "      <td>9564.083038</td>\n",
       "      <td>1470.800984</td>\n",
       "      <td>30.085960</td>\n",
       "      <td>120.0</td>\n",
       "      <td>48229</td>\n",
       "      <td>131.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-10-01</td>\n",
       "      <td>10147.676733</td>\n",
       "      <td>313.051902</td>\n",
       "      <td>30.085821</td>\n",
       "      <td>120.0</td>\n",
       "      <td>48229</td>\n",
       "      <td>131.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-11-01</td>\n",
       "      <td>10166.494929</td>\n",
       "      <td>225.131725</td>\n",
       "      <td>30.085821</td>\n",
       "      <td>120.0</td>\n",
       "      <td>48229</td>\n",
       "      <td>131.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-12-01</td>\n",
       "      <td>9489.427023</td>\n",
       "      <td>297.878360</td>\n",
       "      <td>30.085821</td>\n",
       "      <td>120.0</td>\n",
       "      <td>48229</td>\n",
       "      <td>131.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-06-01</td>\n",
       "      <td>8309.693830</td>\n",
       "      <td>1406.061791</td>\n",
       "      <td>30.085821</td>\n",
       "      <td>120.0</td>\n",
       "      <td>48229</td>\n",
       "      <td>131.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-07-01</td>\n",
       "      <td>8246.674083</td>\n",
       "      <td>1451.494730</td>\n",
       "      <td>30.085821</td>\n",
       "      <td>120.0</td>\n",
       "      <td>48229</td>\n",
       "      <td>131.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-08-01</td>\n",
       "      <td>8568.493543</td>\n",
       "      <td>1890.084329</td>\n",
       "      <td>30.085821</td>\n",
       "      <td>120.0</td>\n",
       "      <td>48229</td>\n",
       "      <td>131.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-01-01</td>\n",
       "      <td>9836.991398</td>\n",
       "      <td>966.415858</td>\n",
       "      <td>30.084709</td>\n",
       "      <td>120.0</td>\n",
       "      <td>48229</td>\n",
       "      <td>131.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-07-01</td>\n",
       "      <td>8932.528302</td>\n",
       "      <td>332.848658</td>\n",
       "      <td>30.055255</td>\n",
       "      <td>120.0</td>\n",
       "      <td>48229</td>\n",
       "      <td>131.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>8057.431446</td>\n",
       "      <td>229.206247</td>\n",
       "      <td>30.055255</td>\n",
       "      <td>120.0</td>\n",
       "      <td>48229</td>\n",
       "      <td>131.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-09-01</td>\n",
       "      <td>7787.454791</td>\n",
       "      <td>144.166270</td>\n",
       "      <td>30.055255</td>\n",
       "      <td>120.0</td>\n",
       "      <td>48229</td>\n",
       "      <td>131.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td rowspan=\"8\" valign=\"top\">20199</td>\n",
       "      <td>2019-03-01</td>\n",
       "      <td>8530.061247</td>\n",
       "      <td>947.623205</td>\n",
       "      <td>25.769783</td>\n",
       "      <td>51.0</td>\n",
       "      <td>20199</td>\n",
       "      <td>65.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-04-01</td>\n",
       "      <td>7627.229153</td>\n",
       "      <td>535.470600</td>\n",
       "      <td>25.769783</td>\n",
       "      <td>51.0</td>\n",
       "      <td>20199</td>\n",
       "      <td>65.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-05-01</td>\n",
       "      <td>7504.487910</td>\n",
       "      <td>972.338605</td>\n",
       "      <td>25.769783</td>\n",
       "      <td>51.0</td>\n",
       "      <td>20199</td>\n",
       "      <td>65.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-02-01</td>\n",
       "      <td>8192.004971</td>\n",
       "      <td>1259.797612</td>\n",
       "      <td>25.769782</td>\n",
       "      <td>51.0</td>\n",
       "      <td>20199</td>\n",
       "      <td>65.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-10-01</td>\n",
       "      <td>8691.875417</td>\n",
       "      <td>268.140995</td>\n",
       "      <td>25.769663</td>\n",
       "      <td>51.0</td>\n",
       "      <td>20199</td>\n",
       "      <td>65.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-11-01</td>\n",
       "      <td>8707.993926</td>\n",
       "      <td>192.833981</td>\n",
       "      <td>25.769663</td>\n",
       "      <td>51.0</td>\n",
       "      <td>20199</td>\n",
       "      <td>65.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2018-12-01</td>\n",
       "      <td>8128.059223</td>\n",
       "      <td>255.144272</td>\n",
       "      <td>25.769663</td>\n",
       "      <td>51.0</td>\n",
       "      <td>20199</td>\n",
       "      <td>65.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2019-06-01</td>\n",
       "      <td>7117.572369</td>\n",
       "      <td>1204.346004</td>\n",
       "      <td>25.769663</td>\n",
       "      <td>51.0</td>\n",
       "      <td>20199</td>\n",
       "      <td>65.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                      total_exp_pc  china_exp_pc     tariff  emplvl_2017  \\\n",
       "area_fips time                                                             \n",
       "53023     2019-03-01  10871.646688   1207.755065  32.843841         37.0   \n",
       "          2019-04-01   9720.978332    682.462529  32.843841         37.0   \n",
       "          2019-05-01   9564.543414   1239.255085  32.843841         37.0   \n",
       "28055     2019-03-01  10871.646688   1207.755065  32.843841         21.0   \n",
       "          2019-04-01   9720.978332    682.462529  32.843841         21.0   \n",
       "          2019-05-01   9564.543414   1239.255085  32.843841         21.0   \n",
       "53023     2019-02-01  10440.790650   1605.624408  32.843840         37.0   \n",
       "28055     2019-02-01  10440.790650   1605.624408  32.843840         21.0   \n",
       "53023     2018-10-01  11077.880433    341.748327  32.843688         37.0   \n",
       "          2018-11-01  11098.423631    245.768800  32.843688         37.0   \n",
       "          2018-12-01  10359.291167    325.183876  32.843688         37.0   \n",
       "          2019-06-01   9071.415764   1534.950789  32.843688         37.0   \n",
       "          2019-07-01   9002.619207   1584.548413  32.843688         37.0   \n",
       "          2019-08-01   9353.938784   2063.342059  32.843688         37.0   \n",
       "28055     2018-10-01  11077.880433    341.748327  32.843688         21.0   \n",
       "          2018-11-01  11098.423631    245.768800  32.843688         21.0   \n",
       "          2018-12-01  10359.291167    325.183876  32.843688         21.0   \n",
       "          2019-06-01   9071.415764   1534.950789  32.843688         21.0   \n",
       "          2019-07-01   9002.619207   1584.548413  32.843688         21.0   \n",
       "          2019-08-01   9353.938784   2063.342059  32.843688         21.0   \n",
       "53023     2019-01-01  10738.715609   1055.003978  32.842474         37.0   \n",
       "28055     2019-01-01  10738.715609   1055.003978  32.842474         21.0   \n",
       "53023     2018-07-01   9751.343396    363.359785  32.810320         37.0   \n",
       "          2018-08-01   8796.029329    250.216820  32.810320         37.0   \n",
       "          2018-09-01   8501.304814    157.381511  32.810320         37.0   \n",
       "28055     2018-07-01   9751.343396    363.359785  32.810320         21.0   \n",
       "          2018-08-01   8796.029329    250.216820  32.810320         21.0   \n",
       "          2018-09-01   8501.304814    157.381511  32.810320         21.0   \n",
       "48229     2019-03-01   9958.760325   1106.340518  30.085961        120.0   \n",
       "          2019-04-01   8904.712976    625.156515  30.085961        120.0   \n",
       "          2019-05-01   8761.413815   1135.195497  30.085961        120.0   \n",
       "          2019-02-01   9564.083038   1470.800984  30.085960        120.0   \n",
       "          2018-10-01  10147.676733    313.051902  30.085821        120.0   \n",
       "          2018-11-01  10166.494929    225.131725  30.085821        120.0   \n",
       "          2018-12-01   9489.427023    297.878360  30.085821        120.0   \n",
       "          2019-06-01   8309.693830   1406.061791  30.085821        120.0   \n",
       "          2019-07-01   8246.674083   1451.494730  30.085821        120.0   \n",
       "          2019-08-01   8568.493543   1890.084329  30.085821        120.0   \n",
       "          2019-01-01   9836.991398    966.415858  30.084709        120.0   \n",
       "          2018-07-01   8932.528302    332.848658  30.055255        120.0   \n",
       "          2018-08-01   8057.431446    229.206247  30.055255        120.0   \n",
       "          2018-09-01   7787.454791    144.166270  30.055255        120.0   \n",
       "20199     2019-03-01   8530.061247    947.623205  25.769783         51.0   \n",
       "          2019-04-01   7627.229153    535.470600  25.769783         51.0   \n",
       "          2019-05-01   7504.487910    972.338605  25.769783         51.0   \n",
       "          2019-02-01   8192.004971   1259.797612  25.769782         51.0   \n",
       "          2018-10-01   8691.875417    268.140995  25.769663         51.0   \n",
       "          2018-11-01   8707.993926    192.833981  25.769663         51.0   \n",
       "          2018-12-01   8128.059223    255.144272  25.769663         51.0   \n",
       "          2019-06-01   7117.572369   1204.346004  25.769663         51.0   \n",
       "\n",
       "                       fips  total_employment  \n",
       "area_fips time                                 \n",
       "53023     2019-03-01  53023              37.0  \n",
       "          2019-04-01  53023              37.0  \n",
       "          2019-05-01  53023              37.0  \n",
       "28055     2019-03-01  28055              21.0  \n",
       "          2019-04-01  28055              21.0  \n",
       "          2019-05-01  28055              21.0  \n",
       "53023     2019-02-01  53023              37.0  \n",
       "28055     2019-02-01  28055              21.0  \n",
       "53023     2018-10-01  53023              37.0  \n",
       "          2018-11-01  53023              37.0  \n",
       "          2018-12-01  53023              37.0  \n",
       "          2019-06-01  53023              37.0  \n",
       "          2019-07-01  53023              37.0  \n",
       "          2019-08-01  53023              37.0  \n",
       "28055     2018-10-01  28055              21.0  \n",
       "          2018-11-01  28055              21.0  \n",
       "          2018-12-01  28055              21.0  \n",
       "          2019-06-01  28055              21.0  \n",
       "          2019-07-01  28055              21.0  \n",
       "          2019-08-01  28055              21.0  \n",
       "53023     2019-01-01  53023              37.0  \n",
       "28055     2019-01-01  28055              21.0  \n",
       "53023     2018-07-01  53023              37.0  \n",
       "          2018-08-01  53023              37.0  \n",
       "          2018-09-01  53023              37.0  \n",
       "28055     2018-07-01  28055              21.0  \n",
       "          2018-08-01  28055              21.0  \n",
       "          2018-09-01  28055              21.0  \n",
       "48229     2019-03-01  48229             131.0  \n",
       "          2019-04-01  48229             131.0  \n",
       "          2019-05-01  48229             131.0  \n",
       "          2019-02-01  48229             131.0  \n",
       "          2018-10-01  48229             131.0  \n",
       "          2018-11-01  48229             131.0  \n",
       "          2018-12-01  48229             131.0  \n",
       "          2019-06-01  48229             131.0  \n",
       "          2019-07-01  48229             131.0  \n",
       "          2019-08-01  48229             131.0  \n",
       "          2019-01-01  48229             131.0  \n",
       "          2018-07-01  48229             131.0  \n",
       "          2018-08-01  48229             131.0  \n",
       "          2018-09-01  48229             131.0  \n",
       "20199     2019-03-01  20199              65.0  \n",
       "          2019-04-01  20199              65.0  \n",
       "          2019-05-01  20199              65.0  \n",
       "          2019-02-01  20199              65.0  \n",
       "          2018-10-01  20199              65.0  \n",
       "          2018-11-01  20199              65.0  \n",
       "          2018-12-01  20199              65.0  \n",
       "          2019-06-01  20199              65.0  "
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "trade_county.sort_values(by = [\"tariff\",\"emplvl_2017\"], ascending = False).head(50)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [],
   "source": [
    "exposure = pd.qcut(trade_county.xs('2015-1-1', level=1).tariff, 4 ,labels = False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "6.291021052902354"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "most_exposed = exposure[exposure == 3].index.tolist()\n",
    "\n",
    "trade_county.loc[most_exposed].xs('2018-12-1', level=1).tariff.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "area_fips\n",
       "10001    2.0\n",
       "10003    0.0\n",
       "10005    3.0\n",
       "1001     2.0\n",
       "1003     1.0\n",
       "Name: tariff, dtype: float64"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "exposure.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "hide_input": false,
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
